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

program will block when page load time out #5426

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

program will block when page load time out #5426

lukeis opened this issue Mar 4, 2016 · 9 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 5426

Hi,

I have a question as follow -
I set driver.manage().timeouts().pageLoadTimeout.
When page load time out will throw TimeoutException, but program will block and cannot
continue.
I hope it will same as selenium RC waitForPageToLoad method, user can catch the exception
but program still can continue, may be I just need check element existing to continue.

Thanks.

Alex Tian

Reported by hokage-ninjia@163.com on 2013-04-01 10:09:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi!

Please provide all necessary information as it was requested at issue creation form:

* browser name and version
* our enviroment
* selenium version
* way of selenium usage: local or remote, etc
* example puplic URL or html+css+js of page at which error is occured
* our test code
* shown error/exception information

Reported by a.u.savchuk on 2013-04-21 07:40:27

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

browser name and version : Firefox (20.0.1)
selenium version : Java (2.32.0)
way of selenium usage: local
example puplic URL : http://www.zennioptical.com/
our test code :

    ...

    this.driver = new FirefoxDriver();
    driver.manage().timeouts().pageLoadTimeout(maxWaitForPageLoad_seconds, TimeUnit.SECONDS);
    driver.manage().timeouts().implicitlyWait(maxWaitForElement_seconds, TimeUnit.SECONDS);
    ...

    try {
        driver.get(url);
    } catch (Exception e) {
        ...
    }

shown error/exception information :
    org.openqa.selenium.TimeoutException: Timed out waiting for page load.
    Command duration or timeout: 8.02 seconds

Reported by hokage-ninjia@163.com on 2013-04-22 02:00:26

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

After I catch the exception, selenium never continue execute below command.

Reported by hokage-ninjia@163.com on 2013-04-22 02:25:27

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Due to site page load slow, so I want set a short timeout value, after timeout continue
check element whether is present.

Reported by hokage-ninjia@163.com on 2013-04-24 01:46:23

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi!

Sorry but i can not reproduce it at my win7, selenium 2.32, ff20
After exception i'm able to find element successfully.
Please see attached test code (in python).

Could you reproduce it with enabled logging - set up the following firefox profie preferences
and use this profile at driver creation:
* 'webdriver.log.driver' = 'ALL'
* 'webdriver.log.file' = '<path>/ff_profile_default.log'
* 'webdriver.log.driver.file' = '<path>/ff_profile_driver.log'
* 'webdriver.log.driver.level' = 'ALL'
* 'webdriver.log.browser.file' = '<path>/ff_profile_browser.log'
* 'webdriver.log.browser.level' = 'ALL'
* 'webdriver.log.profiler.file' = '<path>/ff_profile_profiler.log'
* 'webdriver.log.profiler.level' = 'ALL'

repeat test and attach generated logs to the issue.

Reported by a.u.savchuk on 2013-05-07 10:04:17

  • Status changed: NeedsClarification
  • Labels added: Browser-Firefox

- _Attachment: [t.py](https://storage.googleapis.com/google-code-attachments/selenium/issue-5426/comment-5/t.py)_ - _Attachment: [t.out.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-5426/comment-5/t.out.txt)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Yeah~
I found it not happen every time.
Following is my debug info-

[main] INFO com.selenium.common.SeleniumTestBase - *DEBUG : The page load timeout is
12 seconds.
[main] INFO com.selenium.common.SeleniumTestBase - *DEBUG : The wait for element present
is 15 seconds.
************Start Open**************
===Open URL -http://www.zennioptical.com/
org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Command duration or timeout: 12.01 seconds
Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version:
'1.7.0_21'
Session ID: 121a4e42-4e87-48c6-92c5-190110e2ccd9
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true,
acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true,
nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true,
applicationCacheEnabled=true, takesScreenshot=true, version=21.0}]
[main] WARN com.selenium.method.CheckElementDisplay - *WARN : Timeout when try to open
the url <http://www.zennioptical.com/>.
Time for open page - 12021(ms)
*************End Open**************
---> Tye to find home page footer = true
Time for find footer - 57877(ms)
************Test**************

After page time out, the page footer display in the page but findElement can't get
it.

Reported by hokage-ninjia@163.com on 2013-05-16 09:13:05

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Fixed. To be released in 2.40.

Reported by barancev on 2014-01-11 19:47:43

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

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

For some reason, I need to use 2.36 version of Selenium. so is there any workaround
for this issue rather than updating selenium version to 2.40?

Reported by Javon901@msn.com on 2014-04-23 07:10:23

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

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

  • 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