Trying to find object by Xpath "How to handle Web Tables"

Good to hear.

So based on your screenshot, it looks like just a syntax error. If you used, word-for-word, the example that I gave, then instead of:

List<WebElement> Rows = Table.findElements(By.tagName('tr'))

you should use:

List<WebElement> rows = table.findElements(By.tagName('tr'))

Notice that the ‘t’ in ‘table’ is lower-case. Your error is saying that it can’t find a variable named Table, because in the example I gave, the variable name is table. Generally speaking, it’s Java/Groovy convention to use camel case when declaring a variable, so try and stick to that.

Edit: I see that the example that you are using doesn’t use camel case, so that’s not your fault :unamused: Either way, don’t get into the bad habit of naming your variables with a starting upper-case character… It will cause you a lot of headaches…

1 Like