I have following dynamic webtable
(checkbox) ID_No country_code Date Time UserName FileName
1 5 10/04/2019 12:05:45 xyz@gmail.com filename1
2 7 10/04/2019 13:05:45 pqr@gmail.com filename2
3 8 10/03/2019 14:05:45 pqr@gmail.com filename2
4 9 10/04/2019 14:08:45 pqr@gmail.com filename1
On the left hand side of the id_no there is a checkbox.I only want to check the rows where FileName='filename1' and Date='10/04/2019'
when I use this xpath in the chrome console: $x("//tr[td[contains(text(),'filename1')]]")[0]'
This contains 1st row that contains "filename1" value.I get following HTML for the rows of this webtable
<tr class="class1">
<td width="2%"> </td> <!–– checkbox ––>
<td width="2%"> 1 </td>
<td width="2%"> 5 </td>
<td width="2%"> 10/04/2019 </td>
<td width="2%"> 12:05:45 </td>
<td width="2%" style=word-wrap:break-word> xyz@gmail.com </td>
<td width="2%"> filename1 </td>
</tr>
To check the checkboxes of rows that contains "filename1" I am using following code
driver = webdriver.Chrome()
driver.get(website_URL)
driver.find_element_by_xpath("//tr[td[contains(text(),'filename1')]]/input").click()
How can I check the checkboxes where FileName='filename1'and Date='10/04/2019'?
Also,How can I uncheck the checkboxes?