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

Opening URL with hash/anchor causes timeout #5165

Closed
lukeis opened this issue Mar 4, 2016 · 10 comments
Closed

Opening URL with hash/anchor causes timeout #5165

lukeis opened this issue Mar 4, 2016 · 10 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 5165

What steps will reproduce the problem?
1. "Open" a URL, e.g. http://en.wikipedia.org/wiki/Yiddish
2. "Open" the same URL but with an anchor/hash, e.g. http://en.wikipedia.org/wiki/Yiddish#20th_century

What is the expected output? What do you see instead?
I would expect Selenium to open that URL, recognize that the page has moved/changed,
and continue with the script. Instead, I see "[error] Timed out after 30000ms."

The example I've attached uses Wikipedia URLs, which is a bit contrived, but it demonstrates
the problem I'm having with a Backbone.js application I'm testing that navigates using
the hash, e.g.:

* http://foo.com/#/login
* http://foo.com/#/dashboard
* http://foo.com/#/user/foo123


Selenium version: IDE 1.10.0
OS: Windows 7
Browser: Firefox
Browser version: 18.0.2

Reported by jonathan@abbett.org on 2013-02-14 15:46:36


- _Attachment: [hash-test.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-5165/comment-0/hash-test.html)_
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

BTW, this question has been asked twice in the Google Group without an answer, in 2008
and 2010:

https://groups.google.com/d/topic/selenium-users/mEhu4SKPAUQ/discussion
https://groups.google.com/d/topic/selenium-users/3uyurUr5EXc/discussion


Reported by jonathan@abbett.org on 2013-02-14 15:49:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2013-02-15 06:50:26

  • Labels added: Component-Core

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2013-03-01 00:17:58

  • Status changed: Accepted
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I know this is no pretty in any case, but I've discovered a workaround to get Seelenium
to work properly with URLs with hashtags (at least for me it seems to work):

mDriver.Navigate().GoToUrl(url);
mDriver.Url = url;
mDriver.Navigate().Refresh();
mDriver.Navigate().GoToUrl(url);

Hope this helps

Reported by lengar85 on 2013-03-05 08:01:03

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

We also encounter this problem, we are using Selenium IDE and the open command with
a new URL reports a timeout error. 

This is very problematic for us because our app is a RIA one and without any command
to only change the URL hash we have to write lot of commands to reproduce the user
path which is equivalent to a simple hash change. 

Is their somebody who knows a trick to perform a hash change using Selenium IDE ? It
would be great to have a 'changeHash' command in Selenium for this purpose.

Thanks.

Reported by baptiste.gaillard@gomoob.com on 2014-03-11 19:55:45

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

As a temp fix we just set the hash in JS

// PHP
protected function navigateHash($hash_url) {

  $this->getEval("window.location = window.location.href.split('#')[0] + '#/' + '$hash_url';");
}

Reported by dustin@dandamoore.com on 2014-03-11 20:01:09

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

FYI, our team stopped using Selenium IDE, and we use the Python Selenium WebDriver with
Behave to write our tests.

Reported by jonathan@abbett.org on 2014-03-11 20:01:38

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Ok, thanks to you responses I finally found a solution. 

In selenium IDE simply use the 'storeEval' command, for example : 
 Command = storeEval
 Target = window.location.hash='events/5000/participants/7011'

Reported by baptiste.gaillard@gomoob.com on 2014-03-11 20:17:37

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Selenium RC is deprecated and the support of Selenium RC is discontinued.

Selenium team is not going to fix remaining issues in Selenium RC and we don't accept
new issue reports on Selenium RC.

On the other side, we continue to accept pull requests and patches from the community.

Reported by barancev on 2015-03-12 21:20:14

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

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

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@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