* Get the first element by different locator types, including strict locator * Should be used in custom helpers: * * ```js * const element = await this.helpers['Playwright']._locateElement({name: 'password'}); * ```
(locator)
| 1778 | * ``` |
| 1779 | */ |
| 1780 | async _locateElement(locator) { |
| 1781 | const context = await this._getContext() |
| 1782 | const elements = await findElements.call(this, context, locator) |
| 1783 | if (elements.length === 0) { |
| 1784 | throw new ElementNotFound(locator, 'Element', 'was not found') |
| 1785 | } |
| 1786 | return selectElement(elements, locator, this) |
| 1787 | } |
| 1788 | |
| 1789 | /** |
| 1790 | * Find a checkbox by providing human-readable text: |
no test coverage detected