New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wedriver pageload timeout #3874

Merged
merged 3 commits into from Dec 27, 2016

Conversation

Projects
None yet
5 participants
@oprudkyi
Contributor

oprudkyi commented Dec 26, 2016

adds support of pageload_timeout config to WebDriver

the amount of time to wait for a page load to complete before throwing an error
calls facebook/webdriver/lib/WebDriverTimeouts.php::pageLoadTimeout($seconds)

This patch allows to reduce issues from phantomjs random freezing, especially within CI environment
ariya/phantomjs#11526

patch based on suggestion from ariya/phantomjs#11526 (comment)

oprudkyi added some commits Dec 26, 2016

add support of pageload_timeout config to WebDriver
the amount of time to wait for a page load to complete before throwing an error
calls facebook/webdriver/lib/WebDriverTimeouts.php::pageLoadTimeout($seconds)
add support of pageload_timeout config to WebDriver
the amount of time to wait for a page load to complete before throwing an error
calls facebook/webdriver/lib/WebDriverTimeouts.php::pageLoadTimeout($seconds)
@@ -114,6 +114,7 @@ you should use a tunnel application provided by a service.
* `capabilities` - Sets Selenium2 [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities). Should be a key-value array.
* `connection_timeout` - timeout for opening a connection to remote selenium server (30 seconds by default).
* `request_timeout` - timeout for a request to return something from remote selenium server (30 seconds by default).
* `pageload_timeout` - amount of time to wait for a page load to complete before throwing an error (default 0 seconds).

This comment has been minimized.

@DavertMik

DavertMik Dec 27, 2016

Member

strange but in default is null in this case. A bit confusing.

@DavertMik

DavertMik Dec 27, 2016

Member

strange but in default is null in this case. A bit confusing.

This comment has been minimized.

@oprudkyi

oprudkyi Dec 27, 2016

Contributor

it's 0 (wait forever) for phantomjs (it seems like so) , though spec says
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-session-page-load-timeout

Unless stated otherwise it is 300,000 milliseconds.

so it implemented in way if value doesn't set by user then used default from underling layer

@oprudkyi

oprudkyi Dec 27, 2016

Contributor

it's 0 (wait forever) for phantomjs (it seems like so) , though spec says
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-session-page-load-timeout

Unless stated otherwise it is 300,000 milliseconds.

so it implemented in way if value doesn't set by user then used default from underling layer

This comment has been minimized.

@DavertMik

DavertMik Dec 27, 2016

Member

ok, I got it. Thanks

@DavertMik

DavertMik Dec 27, 2016

Member

ok, I got it. Thanks

@DavertMik DavertMik merged commit bbfbe74 into Codeception:2.2 Dec 27, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 27, 2016

Member

Thank you, it should be useful

Member

DavertMik commented Dec 27, 2016

Thank you, it should be useful

@loesalleman

This comment has been minimized.

Show comment
Hide comment
@loesalleman

loesalleman Jan 20, 2017

Since 2.2.8 my tests stopped running with the following error:
Undefined index: pageload_timeout

So I suppose there is no default for this setting? I added this config setting as pageload_timeout: 0, but the tests now fail, with a timeout exception:

[Facebook\WebDriver\Exception\TimeOutException]
  timeout: cannot determine loading status
  from timeout: Timed out receiving message from renderer: -0.001
    (Session info: chrome=55.0.2883.87)

Only when I set pageload_timeout to some higher value (I used 5) my test can run again.

So for me the problem is now solved but I do not think setting this config option should be forced this way.

loesalleman commented Jan 20, 2017

Since 2.2.8 my tests stopped running with the following error:
Undefined index: pageload_timeout

So I suppose there is no default for this setting? I added this config setting as pageload_timeout: 0, but the tests now fail, with a timeout exception:

[Facebook\WebDriver\Exception\TimeOutException]
  timeout: cannot determine loading status
  from timeout: Timed out receiving message from renderer: -0.001
    (Session info: chrome=55.0.2883.87)

Only when I set pageload_timeout to some higher value (I used 5) my test can run again.

So for me the problem is now solved but I do not think setting this config option should be forced this way.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Jan 20, 2017

Member

@loesalleman Please run codeception with -vvv flag and provide a stack trace of undefined index error.

Member

Naktibalda commented Jan 20, 2017

@loesalleman Please run codeception with -vvv flag and provide a stack trace of undefined index error.

@oprudkyi

This comment has been minimized.

Show comment
Hide comment
@oprudkyi

oprudkyi Jan 20, 2017

Contributor

@loesalleman

Undefined index: pageload_timeout

according to source - https://github.com/Codeception/Codeception/blob/2.2.8/src/Codeception/Module/WebDriver.php if you have not set pageload_timeout then it's ignored (your tests may call WebDriver directly though, so you probably should grep over your 'tests' directory to be sure if some helper doesn't help here)

I added this config setting as pageload_timeout: 0
Timed out receiving message from renderer: -0.001
(Session info: chrome=55.0.2883.87)

hm, it seems like chrome sees 0 as no timeout at all

Only when I set pageload_timeout to some higher value (I used 5) my test can run again.

you probably may use 30 to avoid possible interference of slow running remote test servers

Contributor

oprudkyi commented Jan 20, 2017

@loesalleman

Undefined index: pageload_timeout

according to source - https://github.com/Codeception/Codeception/blob/2.2.8/src/Codeception/Module/WebDriver.php if you have not set pageload_timeout then it's ignored (your tests may call WebDriver directly though, so you probably should grep over your 'tests' directory to be sure if some helper doesn't help here)

I added this config setting as pageload_timeout: 0
Timed out receiving message from renderer: -0.001
(Session info: chrome=55.0.2883.87)

hm, it seems like chrome sees 0 as no timeout at all

Only when I set pageload_timeout to some higher value (I used 5) my test can run again.

you probably may use 30 to avoid possible interference of slow running remote test servers

@loesalleman

This comment has been minimized.

Show comment
Hide comment
@loesalleman

loesalleman Jan 23, 2017

@oprudkyi , Thanks! I must have gotten the error because I do an extend on the Webdriver class and do some stuff to be able to set other custom config settings. I should have thought of this in the first place and make a better solution :).

loesalleman commented Jan 23, 2017

@oprudkyi , Thanks! I must have gotten the error because I do an extend on the Webdriver class and do some stuff to be able to set other custom config settings. I should have thought of this in the first place and make a better solution :).

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

Wedriver pageload timeout (#3874)
* add support of pageload_timeout config to WebDriver

the amount of time to wait for a page load to complete before throwing an error
calls facebook/webdriver/lib/WebDriverTimeouts.php::pageLoadTimeout($seconds)

* add support of pageload_timeout config to WebDriver

the amount of time to wait for a page load to complete before throwing an error
calls facebook/webdriver/lib/WebDriverTimeouts.php::pageLoadTimeout($seconds)

* fix syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment