Data Driven Excel Rows

4 posts, 0 answers
  1. Mike
    Mike avatar
    2 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    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) ?
  2. Mike
    Mike avatar
    2 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    I got the loop feature to work the way I wanted now.
  3. Byron
    Admin
    Byron avatar
    184 posts

    Posted 22 May 2012 Link to this post

    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
  4. Naveen
    Naveen avatar
    4 posts
    Member since:
    Jun 2012

    Posted 30 May 2012 Link to this post

    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
Back to Top