Skip to content

Commit 01131b2

Browse files
committed
[py] update execute_script and execute_async_script docstring for usages
1 parent bb440e3 commit 01131b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ def execute_script(self, script, *args):
612612
- \*args: Any applicable arguments for your JavaScript.
613613
614614
:Usage:
615-
driver.execute_script('document.title')
615+
driver.execute_script('return document.title;')
616616
"""
617617
converted_args = list(args)
618618
command = None
@@ -634,7 +634,9 @@ def execute_async_script(self, script, *args):
634634
- \*args: Any applicable arguments for your JavaScript.
635635
636636
:Usage:
637-
driver.execute_async_script('document.title')
637+
script = "var callback = arguments[arguments.length - 1]; " \
638+
"window.setTimeout(function(){ callback('timeout') }, 3000);"
639+
driver.execute_async_script(script)
638640
"""
639641
converted_args = list(args)
640642
if self.w3c:

0 commit comments

Comments
 (0)