Unable to load url about:blank #312

Closed
seangeo opened this Issue Apr 4, 2012 · 2 comments

Projects

None yet

3 participants

Contributor
seangeo commented Apr 4, 2012

In our testing of capybara-webkit for Still Alive, we've come across some rare scenarios where the Reset command will generate the error "Unable to load url about:blank". I've done a lot of debugging and tracing of the execution at it seems to come down to an issue where the loadFinished signal triggered by the stop command in Reset is fired after the page is set to about:blank. The PageLoadingCommand then interprets this as a failure in the context of the about:blank load and you get the above error message and ultimately an exception thrown but Capybara.reset_sessions!.

This is very intermittent and we probably wouldn't have noticed it if it weren't for our use of long running webkit processes. I haven't been able to characterise exactly what causes it and even when running the exact same sequence of commands it sometimes occur and sometimes not.

To maybe describe it better, here is some logging output:

# A successful reset
stop issue
pendingLoadFinished:
  Unable to load URL: http://example.com
stop done
about:blank loaded
pageLoadStarted
pendingLoadFinished: success = 1
finishCommand:  success = 1

# A failed reset
stop issued
stop done
about:blank loaded
pageLoadStarted
reset done
pendingLoadFinished: success = 0
  Unable to load URL: about:blank  # Pretty sure this is a previous URL that failed, not about:blank right?
finishCommand: success = 0

I know this is one of those difficult issues to track down, I was mainly after advice on a possible solution, which I could implement.

I was thinking we could add a method to Commands that returns a boolean indicating whether they should fail on page load or not. PageLoadingCommand#pendingLoadFinished(bool) could then use that flag to decide whether a failed page load should trigger a failure of that command or not.

Does that sound like a reasonable solution to the problem?

Owner
jferris commented Jul 11, 2012

I recently changed capybara-webkit to be less paranoid about page load failures. Can you try this again on the latest master?

Collaborator
mhoran commented Apr 2, 2013

We no longer load about:blank on page reset, so this should not be an issue.

@mhoran mhoran closed this Apr 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment