(elements, locator, helper)
| 4605 | } |
| 4606 | |
| 4607 | function assertOnlyOneElement(elements, locator, helper) { |
| 4608 | if (elements.length > 1) { |
| 4609 | const webElements = elements.map(el => new WebElement(el, helper)) |
| 4610 | throw new MultipleElementsFound(locator, webElements) |
| 4611 | } |
| 4612 | } |
| 4613 | |
| 4614 | function $XPath(element, selector) { |
| 4615 | const found = document.evaluate(selector, element || document.body, null, 5, null) |