| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library webdriver; | 5 library webdriver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:json' as json; | 9 import 'dart:json' as json; |
| 10 | 10 |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 Future<String> getElementWithFocus() => _post('element/active'); | 875 Future<String> getElementWithFocus() => _post('element/active'); |
| 876 | 876 |
| 877 /** | 877 /** |
| 878 * Search for an element on the page, starting from element with id [id]. | 878 * Search for an element on the page, starting from element with id [id]. |
| 879 * The located element will be returned as WebElement JSON objects. See | 879 * The located element will be returned as WebElement JSON objects. See |
| 880 * [findElement] for the locator strategies that each server supports. | 880 * [findElement] for the locator strategies that each server supports. |
| 881 * | 881 * |
| 882 * Potential Errors: NoSuchWindow, XPathLookupError. | 882 * Potential Errors: NoSuchWindow, XPathLookupError. |
| 883 */ | 883 */ |
| 884 Future<String> | 884 Future<String> |
| 885 findElementFromId(String id, String strategy, String searchValue) { | 885 findElementFromId(String id, String strategy, String searchValue) => |
| 886 _post('element/$id/element', { 'using': strategy, 'value' : searchValue }); | 886 _post('element/$id/element', |
| 887 } | 887 { 'using': strategy, 'value' : searchValue }); |
| 888 | 888 |
| 889 /** | 889 /** |
| 890 * Search for multiple elements on the page, starting from the element with | 890 * Search for multiple elements on the page, starting from the element with |
| 891 * id [id].The located elements will be returned as WebElement JSON objects. | 891 * id [id].The located elements will be returned as WebElement JSON objects. |
| 892 * See [findElement] for the locator strategies that each server supports. | 892 * See [findElement] for the locator strategies that each server supports. |
| 893 * Elements are be returned in the order located in the DOM. | 893 * Elements are be returned in the order located in the DOM. |
| 894 * | 894 * |
| 895 * Potential Errors: NoSuchWindow, XPathLookupError. | 895 * Potential Errors: NoSuchWindow, XPathLookupError. |
| 896 */ | 896 */ |
| 897 Future<List<String>> | 897 Future<List<String>> |
| 898 findElementsFromId(String id, String strategy, String searchValue) => | 898 findElementsFromId(String id, String strategy, String searchValue) => |
| 899 _post('element/$id/elements', | 899 _post('element/$id/elements', |
| 900 params: { 'using': strategy, 'value' : searchValue }); | 900 { 'using': strategy, 'value' : searchValue }); |
| 901 | |
| 902 /** | 901 /** |
| 903 * Click on an element specified by [id]. | 902 * Click on an element specified by [id]. |
| 904 * | 903 * |
| 905 * Potential Errors: NoSuchWindow, StaleElementReference, ElementNotVisible | 904 * Potential Errors: NoSuchWindow, StaleElementReference, ElementNotVisible |
| 906 * (if the referenced element is not visible on the page, either hidden | 905 * (if the referenced element is not visible on the page, either hidden |
| 907 * by CSS, or has 0-width or 0-height). | 906 * by CSS, or has 0-width or 0-height). |
| 908 */ | 907 */ |
| 909 Future clickElement(String id) => _post('element/$id/click'); | 908 Future clickElement(String id) => _post('element/$id/click'); |
| 910 | 909 |
| 911 /** | 910 /** |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 * | 1459 * |
| 1461 * 'timestamp' (int) - The timestamp of the entry. | 1460 * 'timestamp' (int) - The timestamp of the entry. |
| 1462 * 'level' (String) - The log level of the entry, for example, "INFO". | 1461 * 'level' (String) - The log level of the entry, for example, "INFO". |
| 1463 * 'message' (String) - The log message. | 1462 * 'message' (String) - The log message. |
| 1464 * | 1463 * |
| 1465 * This works with Firefox but Chrome returns a 500 response due to a | 1464 * This works with Firefox but Chrome returns a 500 response due to a |
| 1466 * bad cast. | 1465 * bad cast. |
| 1467 */ | 1466 */ |
| 1468 Future<List<Map>> getLogs(String type) => _post('log', { 'type': type }); | 1467 Future<List<Map>> getLogs(String type) => _post('log', { 'type': type }); |
| 1469 } | 1468 } |
| OLD | NEW |