Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2904)

Unified Diff: chrome/test/chromedriver/chromedriver.py

Issue 12675002: [chromedriver] Implement command: executeAsyncScript and setScriptTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/chromedriver.py
diff --git a/chrome/test/chromedriver/chromedriver.py b/chrome/test/chromedriver/chromedriver.py
index 8e4bb470ef917f950bb55837f27914d12ca99586..796f71c1e5fd94ed2ba37e6b1118e0ff16d7b5a6 100644
--- a/chrome/test/chromedriver/chromedriver.py
+++ b/chrome/test/chromedriver/chromedriver.py
@@ -17,8 +17,12 @@ class StaleElementReference(ChromeDriverException):
pass
class UnknownError(ChromeDriverException):
pass
+class JavaScriptError(ChromeDriverException):
+ pass
class XPathLookupError(ChromeDriverException):
pass
+class Timeout(ChromeDriverException):
+ pass
class NoSuchWindow(ChromeDriverException):
pass
class InvalidSelector(ChromeDriverException):
@@ -34,7 +38,9 @@ def _ExceptionForResponse(response):
9: UnknownCommand,
10: StaleElementReference,
13: UnknownError,
+ 17: JavaScriptError,
19: XPathLookupError,
+ 21: Timeout,
23: NoSuchWindow,
32: InvalidSelector,
33: SessionNotCreatedException,
@@ -152,6 +158,11 @@ class ChromeDriver(object):
return self.ExecuteSessionCommand(
'executeScript', {'script': script, 'args': converted_args})
+ def ExecuteAsyncScript(self, script, *args):
+ converted_args = list(args)
+ return self.ExecuteSessionCommand(
+ 'executeAsyncScript', {'script': script, 'args': converted_args})
+
def SwitchToFrame(self, id_or_name):
self.ExecuteSessionCommand('switchToFrame', {'id': id_or_name})

Powered by Google App Engine
This is Rietveld 408576698