Passing variable is declared as undefined/null while looping
Passing variable is declared as undefined/null while looping,this is seen 4 out of 10 times.If the number of rows is ten at any row number Testcomplete will throw error that one of the variable is undefined/null.
browser.FindChildByXpath(tablexPath+"//tr[undefined]/td[" + j + "]");
The variable [i] or [j] is declared as null/undefined 4 out of 10 times while looping through the elements.
See the example below:
var rows=browser.FindChildByXpath(xPathtable); var cols =browser.FindChildByXpath(xPathColumn); for (int i =1;i<rows.RowCount;i++) { for (int j =1;j<col.ColumnCount;j++){
["Delay"](3000)
var textValue=browser.FindChildByXpath(tablexPath+"//tr[" + i + "]/td[" + j + "]");
textValue.contentText; }}
Put a breakpoint in before the loops, add your variables to the watch list, and then run this code in debug mode and step through it a line at a time. You should be able to see the conditions that cause it to see the null value.
If you do this several times and do not see the error state, then consider that you have a timing issue and may need to slow this bit of code down for all the values to be registered properly.