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

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

Issue 12224106: [chromedriver] Implement command: switchToWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chromedriver.py
diff --git a/chrome/test/chromedriver/chromedriver.py b/chrome/test/chromedriver/chromedriver.py
index b1783f4bf7abdf941212d8981a717d9d8024f8ba..63adddc656bbbc31cb58819ee34c122436a3b616 100644
--- a/chrome/test/chromedriver/chromedriver.py
+++ b/chrome/test/chromedriver/chromedriver.py
@@ -19,6 +19,8 @@ class UnknownError(ChromeDriverException):
pass
class XPathLookupError(ChromeDriverException):
pass
+class NoSuchWindow(ChromeDriverException):
+ pass
class InvalidSelector(ChromeDriverException):
pass
class SessionNotCreatedException(ChromeDriverException):
@@ -33,6 +35,7 @@ def _ExceptionForResponse(response):
10: StaleElementReference,
13: UnknownError,
19: XPathLookupError,
+ 23: NoSuchWindow,
32: InvalidSelector,
33: SessionNotCreatedException,
100: NoSuchSession
@@ -126,6 +129,9 @@ class ChromeDriver(object):
def GetWindowHandles(self):
return self.ExecuteSessionCommand('getWindowHandles')
+ def SwitchToWindow(self, handle_or_name):
+ self.ExecuteSessionCommand('switchToWindow', {'name': handle_or_name})
+
def GetCurrentWindowHandle(self):
return self.ExecuteSessionCommand('getCurrentWindowHandle')
« no previous file with comments | « no previous file | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698