Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd API to set page load timeout #1535
Comments
|
One more note: I'd be happy to provide a pull request for either solution, but I can't say for sure when this would be possible due to the necessary code contribution approval process from my employer. |
|
Page load timeout is (usually) bigger than the other timeouts in the library. Usually current timeouts are less then 60 seconds (more close to 15 seconds in my usual use) and page load timeout can be multiple of minutes. Of course this highly depends on the web application performance and numerous other factors. At least we should add keyword to set the page load timeout, in similar functionality Set Selenium Timeout. But should page load timeout be also library level import? It is question which does not have clear answer. Page load timeout is not needed that often than other timeouts, but for consistency reason it would be good to have in the library init. I would say that consistency is good thing in this matter and lets add it in the library init too. This might hard to test in the acceptance test, but it might be easy to test in the unit test. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Today, I stumbled upon the lack of ability to set the page load timeout defined by the W3C WebDriver standard [1]. The underlying Python Selenium implementation does provide a corresponding
set_page_load_timeoutmethod inselenium.webdriver.remote.webdriver.WebDriver[2].Too me, it is not completely clear how this should be handled on the library level. SeleniumLibrary currently has two kinds of timeouts. The library timeout is both the library-own default timeout for the waiting keywords as well as the script timeout from the WebDriver standard. The implicit wait timeout is only a direct pass-through to the implicit wait timeout from the WebDriver standard. I don't know exactly why the WebDriver standard has a separate page load timeout, but it should be exposed on the library level as well, I think.
The question is, should SeleniumLibrary just use the existing library-level timeout for the page load timeout as well? This would mean that you basically loose the separation on the WebDriver level and have a single configuration parameter for script timeout and page load timeout.
The other solution would be to add another set of parameters and keywords for the page load timeout itself. This way, the separation from the WebDriver level is also exposed on the library level. But it would probably mean an API-breaking change is necessary, adding another parameter to the library
__init__as well as some more keywords specifically for the page load timeout.[1] https://w3c.github.io/webdriver/#timeouts
[2] https://github.com/SeleniumHQ/selenium/blob/5d0099de8401c3e5b58f58bd227c46d95da7c8a7/py/selenium/webdriver/remote/webdriver.py#L967