Selenium--The error message is: table.rows[row] is undefined -
Selenium--The error message is: table.rows[row] is undefined -
please see below example. whenever utilize counter in row see below error message:
error: command execution failure. please search forum @ http://clearspace.openqa.org error details log window. error message is: table.rows[row] undefined
public static string verifylinkedsubmissions(string articletitle){ int rowcount=0; string truestring="submission found"; string falsestring="submission 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+" found"); homecoming truestring; } } log.error("title name: "+articletitle+" not found in linked submissions"); homecoming falsestring; }
if hard code row number script runs smooth. want search particular articletitle in case , verify nowadays in table or not.
the help appreciated.
the problem here row , column reference in gettable
command must start @ 0. need alter for
loop starts @ 0 follows:
for(int i=0; i<rowcount; i++) { string val=selenium.gettable("linkedwithrepeater."+i+".4"); if (val.equals(articletitle)){ log.info("title name "+articletitle+" found"); homecoming truestring; } }
note may need alter column reference 3 if have not taken business relationship starting 0.
also, in code sample utilize both browser
, selenium
when using selenium api commands. assume copy/paste mistake, may want double check that.
see http://release.seleniumhq.org/selenium-core/1.0/reference.html#storetable details of xtable commands.
selenium
Comments
Post a Comment