1

I am having trouble making my Selenium-Webdriver script check Susie's checkbox. I have tried using clicking and sending space keys, and also changing my xpaths. Could someone please help me find a way of specifying that I need Susie's checkbox, and also help me click it?

HTML on page

<tr class="dataRow">
    <td class="jtable-selecting-column">
         <input type="checkbox">
    </td>
    <td class=" FirstName ">Laura</td>
    <td class=" LastName ">Test</td>
    <td class=" SMSNumber ">4444444444</td>
    </tr>
<tr class="dataRow">
    <td class="jtable-selecting-column">
         <input type="checkbox">
    </td>
    <td class=" FirstName ">Susie</td>
    <td class=" LastName ">Test</td>
    <td class=" SMSNumber ">5555555555</td>

my code

WebDriverWait waitPlease = new WebDriverWait(webDriver, TimeSpan.FromSeconds(10));
IWebElement myDynamicElement = waitPlease.Until<IWebElement>(d => d.FindElement(By.ClassName(" FirstName ")));   

clickButtonWithXPath("/html/body/div[3]/div[1]/div[2]/div[2]/div[2]/div[1]/div/table/tbody/tr[4]/td[1]/input");

Error

reads "System.InvalidOperationException:unknown error: Element is not clickable at point (192,464). Other element would receive the click: ...

1 Answers1

0

It turned out the the XPath was working just fine, but the script wasn't waiting long enough. Unfortunately, Thread.sleep(5000) is the only wait I've found that works effectively.

Edit: Thanks so much everyone! It turns out that using xpaths was a reliable way of referencing the checkbox, but Selenium needed to be instructed to wait before attempting to click it. The best way to do this is with explicit wait. I used the code on this documentation page under "expected conditions".