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

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

Issue 11884058: [chromedriver] Implement commands: findChildElement, findChildElements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 dee04bfb40d7abde1182b8a308ee95b6353d8061..7da8215c8d56a00b955b549d0e78d23f2238a9be 100644
--- a/chrome/test/chromedriver/chromedriver.py
+++ b/chrome/test/chromedriver/chromedriver.py
@@ -11,6 +11,8 @@ class NoSuchElement(ChromeDriverException):
pass
class UnknownCommand(ChromeDriverException):
pass
+class StaleElementReference(ChromeDriverException):
+ pass
class UnknownError(ChromeDriverException):
pass
class XPathLookupError(ChromeDriverException):
@@ -26,6 +28,7 @@ def _ExceptionForResponse(response):
exception_class_map = {
7: NoSuchElement,
9: UnknownCommand,
+ 10: StaleElementReference,
13: UnknownError,
19: XPathLookupError,
32: InvalidSelector,
@@ -104,6 +107,16 @@ class ChromeDriver(object):
return self._ExecuteSessionCommand(
'findElements', {'using': strategy, 'value': target})
+ def FindChildElement(self, root_element, strategy, target):
kkania 2013/01/15 22:24:36 we should create a Element class that has these me
chrisgao (Use stgao instead) 2013/01/16 19:06:24 Done.
+ return self._ExecuteSessionCommand(
+ 'findChildElement',
+ {'using': strategy, 'value': target, 'id' : root_element})
+
+ def FindChildElements(self, root_element, strategy, target):
+ return self._ExecuteSessionCommand(
+ 'findChildElements',
+ {'using': strategy, 'value': target, 'id' : root_element})
+
def SetTimeout(self, type, timeout):
return self._ExecuteSessionCommand(
'setTimeout', {'type' : type, 'ms': timeout})
« no previous file with comments | « no previous file | chrome/test/chromedriver/command_executor_impl.cc » ('j') | chrome/test/chromedriver/commands.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698