browser.check_if#
Functions#
contains_any_text(xpath)
#
Check if element contains any text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
contains_text(xpath, regex, ignore_case=True)
#
Check if element contains text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
regex | str | Regular expression or text to search for. The condition works for both ordinary text (e.g. | required |
ignore_case | bool | Ignore case when searching for text. | True |
Returns:
Type | Description |
---|---|
bool |
|
Example
Without regular expression:
With regular expression:
does_exist(xpath)
#
is_clickable(xpath)
#
Check if element is clickable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
is_disabled(xpath)
#
Check if element is disabled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
is_displayed(xpath)
#
Check visibility status of an element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
is_enabled(xpath)
#
is_image_loaded(xpath)
#
Check is image is loaded and ready in the DOM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
is_in_viewport(xpath)
#
Check if an element is visible in the current viewport.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|
is_selected(xpath)
#
Check if element is selected, e.g. checkbox or radio button.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
Returns:
Type | Description |
---|---|
bool |
|