Skip to content

Commit 01e76ca

Browse files
[py] Update W3C Timeout setting to be in line with the specification
1 parent ed3beaf commit 01e76ca

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,7 @@ def implicitly_wait(self, time_to_wait):
688688
"""
689689
if self.w3c:
690690
self.execute(Command.SET_TIMEOUTS, {
691-
'ms': float(time_to_wait) * 1000,
692-
'type': 'implicit'})
691+
'implicit': int(float(time_to_wait) * 1000)})
693692
else:
694693
self.execute(Command.IMPLICIT_WAIT, {
695694
'ms': float(time_to_wait) * 1000})
@@ -707,8 +706,7 @@ def set_script_timeout(self, time_to_wait):
707706
"""
708707
if self.w3c:
709708
self.execute(Command.SET_TIMEOUTS, {
710-
'ms': float(time_to_wait) * 1000,
711-
'type': 'script'})
709+
'script': int(float(time_to_wait) * 1000)})
712710
else:
713711
self.execute(Command.SET_SCRIPT_TIMEOUT, {
714712
'ms': float(time_to_wait) * 1000})
@@ -725,8 +723,7 @@ def set_page_load_timeout(self, time_to_wait):
725723
driver.set_page_load_timeout(30)
726724
"""
727725
self.execute(Command.SET_TIMEOUTS, {
728-
'ms': float(time_to_wait) * 1000,
729-
'type': 'page load'})
726+
'page load': int(float(time_to_wait) * 1000)})
730727

731728
def find_element(self, by=By.ID, value=None):
732729
"""

0 commit comments

Comments
 (0)