Telerik blogs

 The Q3 release is upon us and we have many new features to tell you about. Our engineers have been hard at work coming up with innovative solutions that will substantially improve your productivity as a QA Engineer. One of these solutions is our new 'Element Extraction' feature. This feature allows you to extract the value of an element and place it into a variable. That variable can then be used by one or more test steps later in your script. It's very easy to setup, let's take a look.

From your recording surface, with the Hover Over Highlighting enabled, select an element and bring up the Element Menu. In this example, I selected the 'Quick Tasks' option as shown below.

Alternatively, you can convert a 'Verify' step to an extraction step by right-clicking and changing the role from Verify to Extraction (see below).

 Once your Extraction has been added, you will notice a small 'eye dropper' icon appear to the left of the step indicating this is an extraction. Now you can rename the variable by double clicking the step to expand the properties, and updating the 'DataBindVariableName' field to whatever you would like. Be sure to make note of this variable name as we will need it later in our test, in this example, I have used 'pw'.

 So, to recap, we have taken the value of an element and placed it into a variable named 'pw'. Our next step is to bind the variable to a test step. To do so, select the step you would like to use the variable on, and use the Data Driven Bindings property (as shown below) to enter the variable name, be sure to use the appropriate syntax, in this case it would be: $(pw).

 Your done! In this example, we extracted a value from an element, dropped the value into the variable named 'pw', then used that value in a 'Set' action step to populate a password textbox with the contents of our variable.

Want to see this in action? Check out the Element Extraction Video on Telerik TV.


Comments are disabled in preview mode.