Page 1 of 1

Validation csv file

Posted: Mon Jun 23, 2014 6:47 pm
by smrse
I am looking to validate certain fields in a csv file. Do I need to import the csv file as a data binding to do this? Another issue, the file is created by the software and will have a different name for each run.
Thanks,
Stephanie

Re: Validation csv file

Posted: Wed Jun 25, 2014 12:54 pm
by Support Team
Hi Stephanie,

There are different approaches how to validate the data of a csv file.
Since Ranorex is based on the .Net framework you could simply use the .Net methods to read the data of a csv file as explained here: Reading and Writing CSV Files in C#. After you read the data you can validate them by using a Ranorex Validate method.
Since Ranorex is basically a GUI testing tool you could also open the csv file in an editor and then track the elements using Ranorex Spy respectively search for the text elements using one of the Ranorex Find methods.
You could also use the data source but this is not the best approach in case the source file changes very often.

Do you know which name will be used by your software to name the csv file in advance?

Regards,
Markus