nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

HTTPRequest url selenium command is hanging forever occasionally. #105

Closed ozymandias547 closed 10 years ago

ozymandias547 commented 10 years ago

When running tests on one of our environments, 1 out of 10 times we get to this situation:

INFO Got sessionId from selenium 4368a3a0-b502-11e3-ab47-95689ec6e7a3
INFO Request: POST /wd/hub/session/4368a3a0-b502-11e3-ab47-95689ec6e7a3/url 
 - data:  {"url":"https://localhost:54781/pagetemplates/about-us"} 
 - headers:  {"Content-Type":"application/json","Content-Length":56}

The server just hangs there forever. It doesn't seem like Selenium is ever giving a response to the url request even though the session has been set. Do you think this a nightwatch issue? If not, is there a way to make a timeout on the HTTPRequest that guarantees a build will never hang like this?

Thanks in advance!

beatfactor commented 10 years ago

Try this: http://nightwatchjs.org/api/timeouts.html. Are there perhaps any scripts in the page that may prevent the page to finish loading?

beatfactor commented 10 years ago

any luck with that?

ozymandias547 commented 10 years ago

Thanks for the suggestion. We'll give that a shot. it's not easy to reproduce, and I'll get back to you when it does and we find out more about using the timeouts command.

ozymandias547 commented 10 years ago

What is the proper usage of the timeouts action? I don't see where to add the timeouts configuration. Could you give an example?

beatfactor commented 10 years ago

I think you just need to do a client.timeouts() before doing anything else.

beatfactor commented 10 years ago

Actually you need to pass in more stuff as seen here: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/timeouts

Also the current implementation is incomplete so it won't work. I'll have to release a fix for it soon.

ozymandias547 commented 10 years ago

Great, I'll give it a good round of real-life tests once it's done.

beatfactor commented 10 years ago

timeouts commands should be working fine now.

ozymandias547 commented 10 years ago

Thanks for setting up the timeouts command. It helped us find out that this is most likely not a nightwatch issue at all. I'm closing this issue as not a bug.