I am trying to get my program to click on a button however I receive errors.
My code:
driver.FindElementById("couponsinc-gallery-selectall").Click();
Error:
An unhandled exception of type 'OpenQA.Selenium.NoSuchElementException' occurred in WebDriver.dll
no such element: Unable to locate element: {"method":"css selector","selector":"#\couponsinc\-gallery\-selectall"}
Here is the code of the button on the page:
<div class="selectall">
<input type="checkbox" class="selectall-chk" id="couponsinc-gallery-selectall">
<label for="couponsinc-gallery-selectall">Clip All</label>
</div>
I've also tried my using FindElementByClassName
but nothing is working. What am I doing wrong?