Access Aliases/NameSpace data through CSV file.
I'm storing the aliases in a CSV file and then I want to call the same through CSV Data Driver to perform data driven testing.
Contents of my CSV file:
"LabelObject","LabelName"
Aliases.TANC.HwndSource_Main.Main.LayoutRoot.myMenu.expApplicantInfoSectionHeader.CustomerInfo.TextblockSocialSecurity,"Social Security:"
JS Function:
function MI8(){
path = "C:\\StoreInformation_Processing.csv";
driver = DDT.CSVDriver(path);
while(!driver.EOF()){
var s1 = driver.Value("LabelObject");
var s2 = driver.Value("LabelName");
Log.Message(s1.Text)
Log.Message(s2)
if(aqString.StrMatches(s1.Text,s2) == true){
Log.Message(s1 + " label name exists and matches with the content text " + s2);
}
else Log.Error(s1 + " label name does not exists and it does not matches with the content text " + s2);
driver.Next();
}
}
The Alias is stored in your CSV file as a string. So, you can't just use it as an object without evaluating the string into an object.
So... change your declaration of s1 to
var s1 = eval(driver.Value("LabelObject"));