Classes
Methods
(async) find(selector, optionsopt) → {Promise.<WebElement>}
Finds an element using a CSS selector, with optional waiting and visibility check.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
selector | string | The CSS selector of the element. | ||||||||||||||||
options | Object | <optional> | Options for finding the element.Properties
|
Throws:
- Throws an error if the element is not found within the timeout.
- Type
- Error
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>
(async) getByClassName(className) → {Promise.<WebElement>}
Finds an element by its class name.
Parameters:
| Name | Type | Description |
|---|---|---|
className | string | The class name of the element. |
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>
(async) getByCss(name) → {Promise.<WebElement>}
Finds an element by its CSS selector.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | The CSS selector of the element. |
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>
(async) getById(id) → {Promise.<WebElement>}
Finds an element by its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id | string | The ID of the element. |
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>
(async) getByName(name) → {Promise.<WebElement>}
Finds an element by its name attribute.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | The name attribute of the element. |
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>
(async) getByXpath(xpath) → {Promise.<WebElement>}
Finds an element by its XPath.
Parameters:
| Name | Type | Description |
|---|---|---|
xpath | string | The XPath query of the element. |
Returns:
A promise that resolves to the WebElement found.
- Type:
- Promise.<WebElement>