Chromium Code Reviews| 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}) |