How to compare the value in UI with the value in CSV

Ranorex Spy, Recorder, and Studio.
kishhari
Posts: 4
Joined: Wed Oct 09, 2013 9:46 pm

How to compare the value in UI with the value in CSV

Post by kishhari » Wed Oct 09, 2013 9:59 pm

Hi,
I am trying to read current version number of the build in my UI, Able to read the value and dispaly it but i want to validate the value passing through a csv file and compare the both csv value and dispalyed value are same so that i can pass the test case as both versions are matching.

As I am beginner need your help...

Pasting my user code for reference

public void abd()
{

IList<Ranorex.DivTag> ilist= exercise_10_03Repository.Instance.CGNMSLogin.ProductDesc.Find<Ranorex.DivTag>(".//div");

Report.Info("the element is " + ilist[3].InnerText);

Console.WriteLine("the element is " + ilist[3].InnerText);


Console.ReadLine();

}

I want to compare the inner text value with the one from csv so that both versions match....

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: How to compare the value in UI with the value in CSV

Post by Swisside » Thu Oct 10, 2013 10:53 am

Hello

What you can do is use your CSV file as a data source for the current test case.

Then you bind a module variable (let's call it VERSIONCSV) to the column where you have the version number.

Afterwards you create another module variable (let's call it VERSIONDISPLAYED). Then you assign the value displayed to the module variable :

Code: Select all

VERSIONDISPLAYED = ilist[3].InnerText;

Finally you just have to set a simple condition

Code: Select all

if (VERSIONDISPLAYED == VERSIONCSV) {
 Validate}
else{ Don't validate}
A simple thank you always does wonders !

kishhari
Posts: 4
Joined: Wed Oct 09, 2013 9:46 pm

Re: How to compare the value in UI with the value in CSV

Post by kishhari » Fri Oct 11, 2013 1:30 am

Thanx guys the suggestion you have provided worked...... Once again thanks alot...