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

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: Address comments. 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/webelement.py
diff --git a/chrome/test/chromedriver/webelement.py b/chrome/test/chromedriver/webelement.py
new file mode 100644
index 0000000000000000000000000000000000000000..3131e0f214b75a0121ca9cb9941381a57b9883be
--- /dev/null
+++ b/chrome/test/chromedriver/webelement.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
kkania 2013/01/16 19:45:10 2013
chrisgao (Use stgao instead) 2013/01/16 20:08:20 Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class WebElement(object):
+ """Reperents an HTML element."""
kkania 2013/01/16 19:45:10 Represents
chrisgao (Use stgao instead) 2013/01/16 20:08:20 Done.
+ 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})
« chrome/test/chromedriver/commands_unittest.cc ('K') | « chrome/test/chromedriver/status.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698