@override
(locator)
| 996 | |
| 997 | /** @override */ |
| 998 | findElement(locator) { |
| 999 | let id |
| 1000 | let cmd = null |
| 1001 | |
| 1002 | if (locator instanceof RelativeBy) { |
| 1003 | cmd = new command.Command(command.Name.FIND_ELEMENTS_RELATIVE).setParameter('args', locator.marshall()) |
| 1004 | } else { |
| 1005 | locator = by.checkedLocator(locator) |
| 1006 | } |
| 1007 | |
| 1008 | if (typeof locator === 'function') { |
| 1009 | id = this.findElementInternal_(locator, this) |
| 1010 | return new WebElementPromise(this, id) |
| 1011 | } else if (cmd === null) { |
| 1012 | cmd = new command.Command(command.Name.FIND_ELEMENT) |
| 1013 | .setParameter('using', locator.using) |
| 1014 | .setParameter('value', locator.value) |
| 1015 | } |
| 1016 | |
| 1017 | id = this.execute(cmd) |
| 1018 | if (locator instanceof RelativeBy) { |
| 1019 | return this.normalize_(id) |
| 1020 | } else { |
| 1021 | return new WebElementPromise(this, id) |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | /** |
| 1026 | * @param {!Function} webElementPromise The webElement in unresolved state |
nothing calls this directly
no test coverage detected