Please see the below example. Whenever I use the i counter in the row then I see the below error message:
ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: table.rows[row] is undefined
public static String verifyLinkedSubmissions(String articleTitle){
int rowCount=0;
String trueString="Submission is found";
String falseString="Submission is NOT found";
rowCount=browser.getXpathCount("//TABLE[@id='LinkedWithRepeater']/TBODY/TR").intValue();
for(int i=1; i<=rowCount; i++){
String val=selenium.getTable("LinkedWithRepeater."+i+".4");
if (val.equals(articleTitle)){
log.info("Title name "+articleTitle+" is found");
return trueString;
}
}
log.error("Title name: "+articleTitle+" is NOT found in the Linked Submissions");
return falseString;
}
If I hard code the row number then the script runs smooth. But I want to search for the particular articleTitle in case and verify it is present in the table or not.
The help is appreciated.
Thanks Aparna