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

Coded Step: Extract value from .CSV file

2 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nate
Top achievements
Rank 1
Nate asked on 24 Feb 2011, 04:47 PM
Hello,
         Is there a way I can extract a value in a coded step from a data bound .csv in the QA Edition? Or do I need to perform this via an ODBC connection?

For example: The Test will run and state that for Iteration #1: CompanyName= Bob'sCompany . I would like to obtain the value "Bob'sCompany" from CompanyName.


Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Cody
Telerik team
answered on 24 Feb 2011, 07:15 PM
Hi Nate,

If your test is already bound to a data source, you can access the data for the current iteration in code via the Data[] object. For example in a coded step you have:

string companyName = (string)Data["CompanyName"];

This will fetch the data for the current iteration from the data column "CompanyName" and place it in the string variable "companyName".

That should get you started. Let us know if you have further questions on this.

Best wishes,
Cody
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Nate
Top achievements
Rank 1
answered on 24 Feb 2011, 07:24 PM
Excellent! That's exactly what I needed to know. Thanks.
Tags
General Discussions
Asked by
Nate
Top achievements
Rank 1
Answers by
Cody
Telerik team
Nate
Top achievements
Rank 1
Share this question
or