OLD | NEW |
---|---|
(Empty) | |
1 # 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.
| |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 class WebElement(object): | |
6 """Reperents an HTML element.""" | |
kkania
2013/01/16 19:45:10
Represents
chrisgao (Use stgao instead)
2013/01/16 20:08:20
Done.
| |
7 def __init__(self, chromedriver, id_): | |
8 self._chromedriver = chromedriver | |
9 self._id = id_ | |
10 | |
11 def _Execute(self, command, params=None): | |
12 if params is None: | |
13 params = {} | |
14 params['id'] = self._id; | |
15 return self._chromedriver.ExecuteSessionCommand(command, params) | |
16 | |
17 def FindElement(self, strategy, target): | |
18 return self._Execute( | |
19 'findChildElement', {'using': strategy, 'value': target}) | |
20 | |
21 def FindElements(self, strategy, target): | |
22 return self._Execute( | |
23 'findChildElements', {'using': strategy, 'value': target}) | |
OLD | NEW |