Forum Discussion

mgurch56's avatar
New Contributor
3 years ago

Unable to access HTML Table rows and cells in Test Script



I am writing a TestComplete script (in JavaScript) to verify that the rows and cols in a HTML table on a page contain the right values.


What I've done so far is something like this:


let test_table = page.NativeWebObject.Find(<"the table's html info">);








My code makes it to the if statement, and logs the amount of rows, but when it tries to log the first row it says it is undefined.


Same thing happens if I try something like test_table.rows[0].innerHTML or test_table.rows[0].cells[0].innerHTML.


Does anybody know how to access the rows and cells data in a given HTML table?