Classes
Methods
(async) byClassName(className) → {Promise.<void>}
Clicks on an element identified by its class name.
Parameters:
Name | Type | Description |
---|---|---|
className | string | The class name of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byClassNameAndWait(className) → {Promise.<void>}
Clicks on an element identified by its class name and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
className | string | The class name of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>
(async) byId(id) → {Promise.<void>}
Clicks on an element located by its ID.
Parameters:
Name | Type | Description |
---|---|---|
id | string | The ID of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byIdAndWait(id) → {Promise.<void>}
Click on link located by the ID attribute. Uses document.getElementById() to find the element. And wait for page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
id | string |
Throws:
Will throw an error if the element is not found
Returns:
Promise object represents when the element has been clicked and the pageCompleteCheck has finished.
- Type:
- Promise.<void>
(async) byJs(js) → {Promise.<void>}
Clicks on an element located by evaluating a JavaScript expression.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The JavaScript expression that evaluates to an element or list of elements. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byJsAndWait(js) → {Promise.<void>}
Clicks on an element located by evaluating a JavaScript expression and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The JavaScript expression that evaluates to an element or list of elements. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>
(async) byLinkText(text) → {Promise.<void>}
Clicks on a link whose visible text matches the given string.
Parameters:
Name | Type | Description |
---|---|---|
text | string | The visible text of the link to click. |
Throws:
- Throws an error if the link is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byLinkTextAndWait(text) → {Promise.<void>}
Clicks on a link whose visible text matches the given string and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
text | string | The visible text of the link to click. |
Throws:
- Throws an error if the link is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>
(async) byName(name) → {Promise.<void>}
Clicks on an element located by its name attribute.
Parameters:
Name | Type | Description |
---|---|---|
name | string | The name attribute of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byPartialLinkText(text) → {Promise.<void>}
Clicks on a link whose visible text contains the given substring.
Parameters:
Name | Type | Description |
---|---|---|
text | string | The substring of the visible text of the link to click. |
Throws:
- Throws an error if the link is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byPartialLinkTextAndWait(text) → {Promise.<void>}
Clicks on a link whose visible text contains the given substring and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
text | string | The substring of the visible text of the link to click. |
Throws:
- Throws an error if the link is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>
(async) bySelector(selector) → {Promise.<void>}
Clicks on an element located by its CSS selector.
Parameters:
Name | Type | Description |
---|---|---|
selector | string | The CSS selector of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) bySelectorAndWait(selector) → {Promise.<void>}
Clicks on an element located by its CSS selector and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
selector | string | The CSS selector of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>
(async) byXpath(xpath) → {Promise.<void>}
Clicks on an element that matches a given XPath selector.
Parameters:
Name | Type | Description |
---|---|---|
xpath | string | The XPath selector of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action is performed.
- Type:
- Promise.<void>
(async) byXpathAndWait(xpath) → {Promise.<void>}
Clicks on an element that matches a given XPath selector and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
xpath | string | The XPath selector of the element to click. |
Throws:
- Throws an error if the element is not found.
- Type
- Error
Returns:
A promise that resolves when the click action and page complete check are finished.
- Type:
- Promise.<void>