title: Selenium Checkbox Triggering an Event
body: <p>I have a method:</p>
  
  <pre><code>     public void clickCheckBox(int index) {
         List&lt;WebElement&gt; sizeList = getSizeList();
         WebElement checkbox = sizeList.get(index);
         Actions action = new Actions(driver);
         action.moveToElement(checkbox).click().build().perform();
   }
  </code></pre>
  
  <p>This method is taking the index of a list of checkboxes and then using Actions class to check the checkbox. I am doing it this way because the page I am currently working with triggers an event when this checkbox is checked so just doing a simple find the checkbox and click doesn't work (event doesn't fire).</p>
  
  <p>My above code is not checking the checkbox and I'm not sure why. Any insight would be great. Please let me know if I didn't provide enough information.</p>
  
  <p>EDIT:</p>
  
  <p>Here is my method getting the size of the list:</p>
  
  <pre><code>     public List&lt;WebElement&gt; getSizeList(){
           List&lt;WebElement&gt; sizeList = body.findElement(By.cssSelector("ul")).findElements(By.cssSelector("li"));
           if(null==sizeList) {
             // oops, couldn't find the element
             LOGGER.error("Failed to locate the 'li' element for the action button");
             return Collections.emptyList();
           }
           return sizeList;
   } 
  </code></pre>
  
  <p>Here is a bit of the HTML:</p>
  
  <pre><code>  &lt;ul&gt;          
    &lt;li&gt;
      &lt;input type="checkbox"&gt;
      &lt;a href="www.url.com" title="8"&gt;8&lt;/a&gt;
  &lt;span class="count"&gt;(1,037)&lt;/span&gt;
  &lt;/li&gt;
  
  
    &lt;li&gt;
      &lt;input type="checkbox"&gt;
      &lt;a href="www.url.com" title="10"&gt;10&lt;/a&gt;
  &lt;span class="count"&gt;(1,047)&lt;/span&gt;
  &lt;/li&gt; ...
  </code></pre>