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....
How to compare the value in UI with the value in CSV
Re: How to compare the value in UI with the value in CSV
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 :
Finally you just have to set a simple condition
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 !
Re: How to compare the value in UI with the value in CSV
Thanx guys the suggestion you have provided worked...... Once again thanks alot...