diff options
author | jmikhail@google.com <jmikhail@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 22:24:14 +0000 |
---|---|---|
committer | jmikhail@google.com <jmikhail@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 22:24:14 +0000 |
commit | 74ddb63b51aadad80a1f00e6fa6746eb31d3cc71 (patch) | |
tree | a2aa3b7c06b929887d03ab8ba4537974ae81e4a9 /third_party | |
parent | f5494d49ab74e3d116540b14db3457558f54c88e (diff) | |
download | chromium_src-74ddb63b51aadad80a1f00e6fa6746eb31d3cc71.zip chromium_src-74ddb63b51aadad80a1f00e6fa6746eb31d3cc71.tar.gz chromium_src-74ddb63b51aadad80a1f00e6fa6746eb31d3cc71.tar.bz2 |
Implemnts the commands in webdriver to preform searching of elements on a page.
/session/:sessionId/timeouts/implicit_wait
/session/:sessionId/element
/session/:sessionId/elements
/session/:sessionId/element/:id/element
/session/:sessionId/element/:id/elements
BUG=none
TEST=webdriver_remote_tests.py
Review URL: http://codereview.chromium.org/3643002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
3 files changed, 13 insertions, 0 deletions
diff --git a/third_party/webdriver/py/selenium/remote/webdriver/WebDriver.py b/third_party/webdriver/py/selenium/remote/webdriver/WebDriver.py index b7246a0..35bff2e 100644 --- a/third_party/webdriver/py/selenium/remote/webdriver/WebDriver.py +++ b/third_party/webdriver/py/selenium/remote/webdriver/WebDriver.py @@ -173,6 +173,17 @@ class WebDriver(object): resp = self._execute(Command.GET_TITLE) return resp['value'] + def set_implicit_wait(self, wait): + """Set the amount of time the driver should wait when searching for + elements. When searching for a single element, the driver should poll + the page until an element is found or the timeout expires, whichever + occurs first. When searching for multiple elements, the driver should + poll the page until at least one element is found or the timeout + expires, at which point it should return an empty list. If this + command is never sent, the driver should default to an implicit wait + of 0ms.""" + self._execute(Command.IMPLICIT_WAIT, {'ms': wait}) + def find_element_by_id(self, id_): """Finds element by id.""" return self._find_element_by("id", id_) diff --git a/third_party/webdriver/py/selenium/remote/webdriver/command.py b/third_party/webdriver/py/selenium/remote/webdriver/command.py index 3eae3b1..b094c5a 100644 --- a/third_party/webdriver/py/selenium/remote/webdriver/command.py +++ b/third_party/webdriver/py/selenium/remote/webdriver/command.py @@ -76,4 +76,5 @@ class Command(object): GET_ELEMENT_ATTRIBUTE = "getElementAttribute" GET_ELEMENT_VALUE_OF_CSS_PROPERTY = "getElementValueOfCssProperty" ELEMENT_EQUALS = "elementEquals" + IMPLICIT_WAIT = "setImplicitWait" SCREENSHOT = "screenshot" diff --git a/third_party/webdriver/py/selenium/remote/webdriver/remote_connection.py b/third_party/webdriver/py/selenium/remote/webdriver/remote_connection.py index 6c23684..5556fc9 100644 --- a/third_party/webdriver/py/selenium/remote/webdriver/remote_connection.py +++ b/third_party/webdriver/py/selenium/remote/webdriver/remote_connection.py @@ -128,6 +128,7 @@ class RemoteConnection(object): Command.GET_CURRENT_URL: ('GET', '/session/$sessionId/url'), Command.GET_TITLE: ('GET', '/session/$sessionId/title'), Command.GET_PAGE_SOURCE: ('GET', '/session/$sessionId/source'), + Command.IMPLICIT_WAIT: ('POST', '/session/$sessionId/timeouts/implicit_wait'), Command.SCREENSHOT: ('GET', '/session/$sessionId/screenshot'), Command.SET_BROWSER_VISIBLE: ('POST', '/session/$sessionId/visible'), |