-
Notifications
You must be signed in to change notification settings - Fork 415
Poltergeist raises Timeout even after page is loaded #468
Comments
After loads of crying and tissue wasting, I have found out that the problem is associated with phantomjs and its onLoadFinished not firing. |
@npassaro I didn't catch have you solved an issue? |
Hi! Most of the text was desperation talking. It is an already known problem(it seemed) with the implementation of phantomjs's webkit websockets. |
Gotcha! Thank you! |
@npassaro I know this was nearly 3 years ago now, but do you recall the phantomjs issue that you were referring to? Or what the resolution was? I have a page that is showing as fully loaded but it's almost like phantomjs is waiting for the open websocket connection to finish, which of course it never does. |
That was exactly the issue. I haven't look at this for a long time but as I remember there is a javascript event that is triggered when the page finishes loading, i.e. For what I understood, and I might be completely wrong, this event is independent of the websocket connection. However, phantomjs 1.9.x used an implementation of Webkit that used an implementation of the websocket standard that was not the standard that won. For some reason, the old Webkit would hang waiting for the websocket to close in order to trigger I this issue is related to this: ariya/phantomjs#11018 See here: https://stackoverflow.com/questions/30302359/phantomjs-not-rendering-angular-websockets-page |
@npassaro Thanks. I managed to fix it in the end by not initialising the websocket straight away. Instead I now initialise it on the window load event. This means that phantomjs sees that the page has loaded and then the websocket is opened. |
@andymantell I believe using PhantomJS 2.1.1 and switching to using puma as the "server" (Capybara.server = :puma) should let websockets work correctly. |
Ah thanks @twalpole, I'll give that a try. Hadn't heard of Puma before |
@twalpole Thanks for the recommendation. Switching to Puma is helping me with a similar issue. |
Hi,
I am using poltergeist with capybara to do some tests. You can see the initialization here:
After this, I try to do a login, the loading is slow but about 12s average. I've already tried tweaking poltergeist timeout init variable but to no avail...
When the Timeout exception is raise a screenshot is taken of the last visited page and I can see the full page in the image. I have already incresead the time out up to 400...
Will start to cry in about 1 hour....
The text was updated successfully, but these errors were encountered: