Index: chrome/test/chromedriver/chromedriver.py |
diff --git a/chrome/test/chromedriver/chromedriver.py b/chrome/test/chromedriver/chromedriver.py |
index b290ac0814ba96c93bc548aa193ba3142a383853..dad8f7d8cd8758b28d13b7793059a0d86d232543 100644 |
--- a/chrome/test/chromedriver/chromedriver.py |
+++ b/chrome/test/chromedriver/chromedriver.py |
@@ -17,12 +17,16 @@ class StaleElementReference(ChromeDriverException): |
pass |
class UnknownError(ChromeDriverException): |
pass |
+class JavaScriptError(ChromeDriverException): |
+ pass |
class XPathLookupError(ChromeDriverException): |
pass |
class NoSuchWindow(ChromeDriverException): |
pass |
class InvalidCookieDomain(ChromeDriverException): |
pass |
+class ScriptTimeout(ChromeDriverException): |
+ pass |
class InvalidSelector(ChromeDriverException): |
pass |
class SessionNotCreatedException(ChromeDriverException): |
@@ -36,9 +40,11 @@ def _ExceptionForResponse(response): |
9: UnknownCommand, |
10: StaleElementReference, |
13: UnknownError, |
+ 17: JavaScriptError, |
19: XPathLookupError, |
23: NoSuchWindow, |
24: InvalidCookieDomain, |
+ 28: ScriptTimeout, |
32: InvalidSelector, |
33: SessionNotCreatedException, |
100: NoSuchSession |
@@ -155,6 +161,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}) |