Page 1 of 1

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

Posted: Wed Oct 09, 2013 9:59 pm
by kishhari
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....

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

Posted: Thu Oct 10, 2013 10:53 am
by Swisside
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}

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

Posted: Fri Oct 11, 2013 1:30 am
by kishhari
Thanx guys the suggestion you have provided worked...... Once again thanks alot...