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

Data Driven Excel Rows

3 Answers 178 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 22 May 2012, 04:00 PM
I am trying to do something that should be simple.  I have an excel table binded to my Test Studio web test.  I want to reference different rows for input values within the same test.  So if I have a column named Amount, what is the correct way to get the 2nd row value from Amount?  Is there a way to do it in the Properties window under bindings?  Like $(Amount,2) ?

3 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 22 May 2012, 06:01 PM
I got the loop feature to work the way I wanted now.
0
Byron
Telerik team
answered on 22 May 2012, 08:42 PM
Hello Mike,

I'm glad you found a solution for your scenario.

If a test uses the Test Studio data driving feature, then the test will repeat until it has iterated through each row of the data source. You can filter between specific rows to specify the particular rows that the test will iterate through, but not make references in one iteration of the test to multiple rows of your data source -- unless you resort to code.

Specifically, you can access the content of a particular cell in your data source using the following C# code, which sets value to the content of the "Amount" column for row 2:

object value = ExecutionContext.ActiveDataRows[2]["Amount"];

Please let us know if we can assist you further.

Kind regards,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Naveen
Top achievements
Rank 1
answered on 30 May 2012, 08:00 PM
Mike,
i am trying to use the excel data and assign the data to certain variables.
can you send me your sample at reddycn@yahoo.com
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Byron
Telerik team
Naveen
Top achievements
Rank 1
Share this question
or