Please see the example below. Whenever I use the i counter in the line, I will see an error message below:
Error: Command execution failure Please search the forum for error details from the log window. The error message is: Table. Line [row] is undefined
public fixed string validated linked animation (string article titles) {int rowCount = 0; String true string = "get submissions"; String falseString = "submission not found"; . ROWCOUNT = browser.getXpathCount ("// table [@ id = 'LinkedWithRepeater'] / tbody / TR") intValue (); (Int i = 1; i & lt; = rowCount; i ++) {string val = selenium.tttable ("linkedwith reporter." +++ "4"); If (val.equals (articleTitle)) {log.info ("title name" + article title + "is found"); Actual returns; }} Log. Terror ("title name:" + article title + "is not linked to submissions"); Return false string; }
If I work hard on the line row then the script runs smooth but I want to search for a special article tilt and verify whether it is present in the table or not.
Help is appreciated.
The problem here is the line and column reference in the getTable
command starting with 0 . You need to change the for
loop, so that it starts at 0 as follows:
for (int i = 0; i & lt; rowCount; I ++) {string val = selenium.tv ("linkedwith repeater." + + + "4"); If (val.equals (articleTitle)) {log.info ("title name" + article title + "is found"); Actual returns; }}
Note that you may have to change your column reference to 3 if you have not started with the account in 0.
In addition, when using the selenium API commands in your code sample you use both browser
and selenium
I think this is a Copy / paste is a mistake, but you may want to check it twice.
Look for details of the Excel command.
Comments
Post a Comment