I've been encountering difficulties in finding elements on a webpage structured like this:
<tr id="filter100" style="...." idx=0
<td>
<div onclick=... style=...
<table dir = "fil">
<tbody>
<tr>
<td>
<img id="imgFil100_1" src="//path..."
<td>
<td>
<img id="imgFil100_2" src="//path..."
<td>
<td>
<img id="imgFil100_3" src="//path..."
<td>
Moreover, I have multiple buttons that follow the pattern of "filterXXX". How can I identify and interact with them.
This is the code snippet I came up with:
List<WebElement> lc = driver.findElements(By.cssSelector("table[id*='imgFil']"));
for (int i = 0; i <= lc.size(); i++) {
lc.get(i).click();}
By the way, apologies for any language mistakes.