browser.input#
Functions#
clear(xpath, timeout=None)
#
Clear any text input from form field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the input field. | required |
timeout | float | None | In seconds. Timeout to wait for element. If | None |
Example
browser.input.clear("//xpath/to/input")
select(xpath, timeout=None)
#
Select input field, similar to clicking the mouse on a form field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the input field. | required |
timeout | float | None | In seconds. Timeout to wait for element. If | None |
Raises:
Type | Description |
---|---|
MethodNotSupportedInHeadlessModeException | Raised if the browser is in headless mode. |
Example
Basic usage:
browser.input.select("//xpath/to/input")
Or use advanced XPath expressions to, for instance, select an input in a dropdown selector with a specific text:
browser.input.select("//xpath/to/input[text()='some text']")
value(xpath, value, timeout=None)
#
Input value into form field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xpath | str | XPath of the element. | required |
value | str | Input value. | required |
timeout | float | None | In seconds. Timeout to wait for element. If | None |
Example
browser.input.value("//xpath/to/input", "some value")