My current project involves using Selenium and Java to interact with a table. I am trying to create a selector that can locate a specific column in the table and perform a right-click action on it. The challenge I am facing is that while it's easy to identify the column based on unique lstype values, I am unable to directly right-click on it. As a workaround, I need to click on the box directly below the column.
Here is an example of what the table looks like: Table
And here is the simplified HTML structure:
<div class="head">
<table>
<tbody>
<tr>
<td class="game" lstype="124"></td>
<td class="game" lstype="245"></td>
<td class="game" lstype="873"></td>
</tr>
</tbody>
</table>
</div>
<div class="body">
<table id="extractBody">
<tbody>
<tr>
<td class="game"></td>
<td class="game"></td>
<td class="game"></td>
</tr>
</tbody>
</table>
</div>
The td elements in the "head" section correspond to the header boxes (highlighted in green), while those in the "body" section are the clickable elements.
I am struggling to figure out how to target the lower boxes based on the lstype values present in the header boxes. Even though I have only shown 3 columns in this example, there are many more in the actual table along with rows.
Any guidance on the use of xpaths or any other approach would be greatly appreciated as I have not been successful with my previous attempts.
Thank you for your assistance!