Skip to content

Commit 999470b

Browse files
author
AutomatedTester
committed
Update timeout methods to work with W3C dialect of JSON Protocol
1 parent 7435be0 commit 999470b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: py/selenium/webdriver/remote/webdriver.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,11 @@ def implicitly_wait(self, time_to_wait):
641641
:Usage:
642642
driver.implicitly_wait(30)
643643
"""
644-
self.execute(Command.IMPLICIT_WAIT, {'ms': float(time_to_wait) * 1000})
644+
if self.capabilities["marionette"] == True:
645+
self.execute(Command.SET_TIMEOUTS,
646+
{'ms': float(time_to_wait) * 1000, 'type':'implicit'})
647+
else:
648+
self.execute(Command.IMPLICIT_WAIT, {'ms': float(time_to_wait) * 1000})
645649

646650
def set_script_timeout(self, time_to_wait):
647651
"""
@@ -654,8 +658,12 @@ def set_script_timeout(self, time_to_wait):
654658
:Usage:
655659
driver.set_script_timeout(30)
656660
"""
657-
self.execute(Command.SET_SCRIPT_TIMEOUT,
658-
{'ms': float(time_to_wait) * 1000})
661+
if self.capabilities["marionette"] == True:
662+
self.execute(Command.SET_TIMEOUTS,
663+
{'ms': float(time_to_wait) * 1000, 'type':'script'})
664+
else:
665+
self.execute(Command.SET_SCRIPT_TIMEOUT,
666+
{'ms': float(time_to_wait) * 1000})
659667

660668
def set_page_load_timeout(self, time_to_wait):
661669
"""

0 commit comments

Comments
 (0)