browser.prompt#
Functions#
input_value(xpath, prompt_message, validate_input_regex=None, timeout=None) #
Prompt user for value through the terminal and insert this value into form field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xpath | str | XPath of form field to insert value into. | required |
prompt_message | str | Message to prompt user with in the terminal. | required |
validate_input_regex | str | None | If provided, the input value will be validated against this regex. | None |
timeout | float | None | In seconds. Timeout to wait for element. If | None |
Example
Basic usage:
browser.prompt.input_value("//xpath/to/input", "Input value:")
In context of a login form:
1 2 3 4 5 6 7 | |
proceed_yes_or_no() #
Prompt user in the terminal whether to proceed or not.
| Allowed Inputs | Description |
|---|---|
y, yes or press Enter/Return | Proceed and return True. |
n, no | Do not proceed and return False. |
| Any other input | Prompt user to try again. |
Returns:
| Type | Description |
|---|---|
bool |
|
Example
Basic usage:
browser.prompt.proceed_yes_or_no():
In context of a script:
1 2 3 4 5 6 7 8 | |