After following the steps below, go further and Get/Set Extracted Variables in Code.
This demonstrates how to extract a value from an element and reuse it later in your test. You can also review our Telerik TV episode on Using Element Extraction (Variables) for a video walk-through of this process.
1. Highlight the desired element, choose Quick Steps > Extract - text contains entry. This example is against a random word generator site.
2. The Extract step is added to the test.
3. Pause recording, double click that step, and change the DataBindVariableName. In this example I renamed it to randomWord.
4. Resume recording and navigate to www.bing.com.
5. Enter any word into the search box and click Submit.
6. Close the browser to stop recording.
7. Highlight the step that sets the search word for the second search engine (step 4 in this example).
8. Click the (Bindings) drop-down in the Properties pane.
9. Select the extracted variable from the value drop-down and click Set.
10. Save and execute the test. 11. A random word is extracted from the first site and used as the query in a Bing search
If you've Set an Extracted Variable in Code, type the variable name in the text box (without the $ notation), click on the brackets and then Set:
2. Go to the Element Steps tab
3. Select Verifications tab and choose Attributes. Specify the attribute that you need and click Add Step.
4. The step is changed to an extraction one.
5. The step is changed to an extraction one.