[py] update execute_script and execute_async_script docstring for usages
@@ -612,7 +612,7 @@ class WebDriver(object):
- \*args: Any applicable arguments for your JavaScript.
:Usage:
- driver.execute_script('document.title')
+ driver.execute_script('return document.title;')
"""
converted_args = list(args)
command = None
@@ -634,7 +634,9 @@ class WebDriver(object):
- \*args: Any applicable arguments for your JavaScript.
:Usage:
- driver.execute_async_script('document.title')
+ script = "var callback = arguments[arguments.length - 1]; " \
+ "window.setTimeout(function(){ callback('timeout') }, 3000);"
+ driver.execute_async_script(script)
"""
converted_args = list(args)
if self.w3c:
