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

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

Issue 11884058: [chromedriver] Implement commands: findChildElement, findChildElements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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
« no previous file with comments | « chrome/test/chromedriver/status.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/webelement.py
diff --git a/chrome/test/chromedriver/webelement.py b/chrome/test/chromedriver/webelement.py
new file mode 100644
index 0000000000000000000000000000000000000000..2488dd3aa436439018591c2b3c67258af6e26c84
--- /dev/null
+++ b/chrome/test/chromedriver/webelement.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class WebElement(object):
+ """Represents an HTML element."""
+ def __init__(self, chromedriver, id_):
+ self._chromedriver = chromedriver
+ self._id = id_
+
+ def _Execute(self, command, params=None):
+ if params is None:
+ params = {}
+ params['id'] = self._id;
+ return self._chromedriver.ExecuteSessionCommand(command, params)
+
+ def FindElement(self, strategy, target):
+ return self._Execute(
+ 'findChildElement', {'using': strategy, 'value': target})
+
+ def FindElements(self, strategy, target):
+ return self._Execute(
+ 'findChildElements', {'using': strategy, 'value': target})
« no previous file with comments | « chrome/test/chromedriver/status.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698