OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 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 """Represents an HTML element.""" |
| 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 |