This section explains how to extract a value so you can store it for use in another scenario step or tool.
Understanding Extractions
A Browser Contents Viewer tool is automatically added to each scenario step recorded from the browser. You can "extract" and store data from those elements, then use those extracted values in additional tools (for instance to populate form fields or to validate data).
Storing a Value
To store a value represented in the rendered page, complete the following from the Browser Contents Viewer’s tool configuration panel (accessible by double-clicking the tool’s node) or the Post-Action Browser Contents tab (for extraction only):
- Right-click the page element whose value you want to validate or store (for example, right-click a link) and choose Extract Value from <element> Element….
- In the wizard that opens, ensure that the desired element is selected in the Property name box.
- If you want to "zoom in" on the value to extract, complete the isolate partial value wizard page. If you want to validate or store the entire string, you can ignore this.
- Sometimes you may only want to validate or send a portion of a property value to a data source. If this is the case, you can isolate the part of the property value to use by enabling Isolate Partial Value using Text Boundaries. You then enter Left-hand and Right-hand text that serve as boundaries for the value that you enter. The preview pane shows you what value will be used based on the boundary values that you have entered. For example, assume that the property value is "
Click here to log in
”: - To isolate the value “
Click
”, leave the left boundary blank and enter “here
” (including the space) in the right boundary. - To isolate the value “
here
”, enter “Click
“ in the left boundary and “to
” in the right boundary (again including spaces). - To isolate the value “
in
”, enter “log
“ (including the space) as the left boundary and leave the right boundary blank.
4. To send the value of the selected property to a data source (so that the value can be used later in another scenario or in another tool):
- Choose Extract the value to a data bank.
- Enter a Column Name by which you will reference this value later (for example, in later scenario steps or in another tool).
When the scenario step is executed, the property value will be extracted from the page and placed into a temporary data source within a column with the specified name. When later parts of the scenario reference the column name, the value stored in the temporary data source will be used for those scenario steps. You can both validate and send a property value to a data source at the same time if desired.
- Sometimes you may only want to validate or send a portion of a property value to a data source. If this is the case, you can isolate the part of the property value to use by enabling Isolate Partial Value using Text Boundaries. You then enter Left-hand and Right-hand text that serve as boundaries for the value that you enter. The preview pane shows you what value will be used based on the boundary values that you have entered. For example, assume that the property value is "
5. Click Finish.
The value will be validated or stored when the scenario is executed.
A Browser Data Bank tool will be chained to the Browser Playback tool. This tool will store the extracted value. The extracted value can be used wherever parameterized values are allowed, such as the value to type into an input in a subsequent scenario step or another tool. If you later want to modify the stored value, you can do so by modifying this tool’s settings.
The element that is the source of an extraction will be highlighted with a solid gray border in the Browser Contents viewer, and in the Post-Action Browser Contents tab of the Browser Data Bank tool.
Extracting Text
To extract text to a browser data bank, complete the following:
Select the text you want to extract.
Right-click the selection and choose Extract Selected Text into Data Bank.
Ensure that the desired extraction settings appear in the dialog that opens.
- Click Finish.