Get Text
AutomatR.Web.GetText
The "Get Text" activity in AutomatR's Web Activities category extracts a text value from a specified UI element. This activity is useful when you need to capture text content from a web page for further processing within your automation workflow.
Properties
Name | Description |
---|---|
Input | |
Element | Allows you to select the web element using the selector window. Use this property if you want to indicate the web element directly within the activity. |
WebElement | Specifies the UI Element variable identified by the "Find Element" or other activities. This allows you to use a previously identified web element in the workflow. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Get Text" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Timeout | Specifies the maximum time (in seconds) to wait for the activity to be executed before throwing an exception. Integer variables containing the timeout duration. The default timeout is set in the Constants.Timeout constant. |
Output | |
Result | Outputs the value of text extracted from the web element. Store the result in a string variable for further operations within the workflow. |
How to use:
- Drag and drop the "Get Text" activity onto the workflow.
- Configure the properties by choosing either the direct web element or providing a UI Element variable.
- Optionally, configure the delay and timeout based on your requirements.
- Create a string variable to store the text result (e.g., "extractedText").
- Execute the workflow to extract the text from the specified web element.
Example: Consider an example where the "Get Text" activity is used to extract the text content of a label on a web page:
Get Text:
Delay: 2
Timeout: 10
Element: Selector forLabelElement
Result: extractedText
In this example, the activity waits for 2 seconds, has a timeout of 10 seconds, and extracts the text content of the web element identified by the selector "forLabelElement." The result is stored in the "extractedText" string variable for further use.