Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

[SafariDriver] Driver hangs waiting for page to load if loading a URL with identical fragment as the URL currently in browser session #7176

Open
lukeis opened this issue Mar 4, 2016 · 4 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7176

If a script performs calls the SafariDriver get method on a URI which contains a fragment
and is identical to the current URI (including fragment) then subsequent commands hang
since the driver is expecting the page to reload which doesn't occur.

What steps will reproduce the problem?
1. Run the attached script - the script hangs when trying to reload a URI which is
identical including the fragment (third get call in this example).

Expected: The script should complete without issue

Selenium version: 2.41.0
OS: OSX 10.9.2
Browser: Safari
Browser version: 7.0.2

I dug a little into this and the cause appears to be that safaridriver.extension.Tab.prototype.loadsNewPage
in safari-driver/extension/tab.js returns true in this example indicating the page
will be reloading which doesn't occur. I am fairly sure that the browser is correct
in not reloading the URI here (it shouldn't on fragment change) but not 100% sure whether
an loading an identical fragment is considered different.

Locally I have changed the loadsNewPage function and removed the check on goog.Uri(url).toString()
since although the comments suggest otherwise the toString() function seems to include
the fragment so may also cause issues if fragments differ (since this would evaluate
to false and the subsequent check would evaluate to true indicating a page reload)
and also resolves to true in this example. I have replaced this with some more detailed
checks on the various URI components which resolves the observed issue.

If my above thinking is correct I can submit my change as a patch.

Reported by stevejeffers on 2014-04-04 10:11:05

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Added example test case

Reported by stevejeffers on 2014-04-04 10:12:21


- _Attachment: [sample_test.java](https://storage.googleapis.com/google-code-attachments/selenium/issue-7176/comment-1/sample_test.java)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by jmleyba on 2014-04-05 00:28:17

  • Labels added: Browser-Safari, Component-WebDriver
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by jmleyba on 2014-04-13 04:42:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 17:46:34

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant