Imagine the following, you have text in your application and you want to validate that it appears on another page ,or you may have a value that you want to use in some calculation at a later step.
If you answered yes to any of these questions, you came to the right place.
Let's see how we can easily extract text and use it...
Click here to run a sample demo of the example below.
How to add
- Hover over the arrow menu where you want to add your validation.
- Click ‘+’ ⇒ Actions tab ⇒ ‘Add extract value step’.
- Select the element you want to extract the value from your app.
- Open the Properties panel and change the name of your variable. The default name will be "value".
If you want to change the element you selected, you don't have to re-record this step.
- Open the Properties panel.
- Hover the Target element image that was previously recorded.
- Click the 'Reassign' button.
- Select a different element from your application.
Note: If you get the message "No app to choose an element from", this means that your application is closed, and you must first get the application to the desired state (by either clicking record or run the test to that step).
Use extracted value
You can use your new parameter in a validation step, set text, custom steps, etc.
In the example below, we'll use it to validate text on another page.
- Record text validation. (Learn more about text validation here)
- Open the properties panel of the text validation step.
- Replace the constant value typed in the Expected value field with the parameter you created.