This is a migrated thread and some comments may be shown as answers.

How to script an if...else using dynamic data bindings?

1 Answer 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 24 Aug 2012, 06:06 PM
I'm getting two different 'Extracted Data Driven Bindings' from the recorder. At the end of the test I want to do an Assert.AreNotEqual() with the two dynamically extracted data values. How can I do this? When I try coding a step, the data bindings aren't available to the coded step.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Aug 2012, 02:02 PM
Hello Alex,

Let's say you have the extracted variables "ExtractedValue1" and "ExtractedValue2"(see screenshot). Then you can use the Data property and the names of the variables to compare the extracted data in a coded step. Here is a sample code:
public void WebTest1_CodedStep()
{
    Assert.AreNotEqual(Data["ExtractedValue1"].ToString(), Data["ExtractedValue3"].ToString());
}

Let me know if you need further assistance on this.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or