I'm writing script to automate test where I've to select multiple rows from table & apply some settings to those rows (by selecting them in a group). For that, I'll have to select multiple rows from table, but I'm not able to select those rows using Selenium.
I tried it using following code (CTRL+select the rows), but it's not working -
$driver.action.key_down(:control).perform
$driver.find_element(:xpath, ".//*[@id='1']/div/div/table/tbody/tr[1]").click
$driver.find_element(:xpath, ".//*[@id='2']/div/div/table/tbody/tr[2]").click
$driver.find_element(:xpath, ".//*[@id='3']/div/div/table/tbody/tr[3]").click
Following are web contents -
<div id="abc" class="unselectable dataTable" emptylineuptext="Lineup is Empty" ...>
<div class="xyz">
<div class="def" style="min-height: 3024px;">
<table class="buffer" style="margin-top: 0px;">
<tbody>
<tr id="1" draggable="true">
<td>
<td>NA</td>
</td>
</tr>
<tr id="2" draggable="true">
<td>
<td>NA</td>
</td>
</tr>
<tr id="3" draggable="true">
<td>
<td>NA</td>
</td>
</tr>
<tr>
.
.
.
</tr>
</tbody>
</table>
</div>
Manually, I can select multiple rows from table. Could someone please tell me the solution?