Skip to content

Commit af52bf2

Browse files
Try use old way of setting page load timeout if new way fails. Fixes #3654
The release version of Firefox doesnt have the latest W3C setPageTimeout algorithm. If the W3C version fails, try the old way.
1 parent 758f676 commit af52bf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,10 @@ def set_page_load_timeout(self, time_to_wait):
722722
:Usage:
723723
driver.set_page_load_timeout(30)
724724
"""
725-
if self.w3c:
725+
try:
726726
self.execute(Command.SET_TIMEOUTS, {
727727
'pageLoad': int(float(time_to_wait) * 1000)})
728-
else:
728+
except WebDriverException:
729729
self.execute(Command.SET_TIMEOUTS, {
730730
'ms': float(time_to_wait) * 1000,
731731
'type': 'page load'})

0 commit comments

Comments
 (0)