Wow, nested tables, everyone’s favorite
This pretty much proves the point in my original response. There’s no way to handle this in a generic way that would work for everyone, so lets work on a custom solution.
I’ll suggest just a solution to get the tracking number for a given row, as identifying a row won’t be too hard, and finding any element within a row is relatively straight forward. But your idea of row AND column gets tricky with nested tables, because there’s no clear definition of what a column is with that setup.
The heart of the solution is going to be your locator. I can suggest an xpath, but I’d like to do it in pieces and you can tell me if they make sense:
1.) Locate the “results table”:
//table[@class='resultsTable']
That should identify this piece:
2.) Within the “results table”, locate the appropriate row:
//table[@class='resultsTable']/tbody/tr[${rowIndex}]
This should identify (depending on the value you’ll provide for “rowIndex”) these:
3.) Within the appropriate row, locate the tracking number:
//table[@class='resultsTable']/tbody/tr[${rowIndex}]//td[@class='headerPIC3']/a
Which should locate the actual numbers, as long as there’s one (and only one) td[@class=‘headerPIC3’] element per row.
4.) Create a test object with that xpath, then call it in your script:
def rowIndex = 1 // this will grab the tracking number for the first row
def trackingNumber = WebUI.getText(findTestObject('path/to/test/object', ['rowIndex' : rowIndex]))
If this works for you, you could create similar test objects for the other elements in the table that you might want to retrieve the text for (Recipient Address, etc.). Give this a try, and let me know if you need anything clarified 