I am trying to click on an element with Selenium. It is a checkbox with HTML Code below:
Code for paragraph that contains checkbox and Terms:
<p class="jss72 jss80 jss927 jss943 jss930">
<span class="js122">
<img src="/images/purple.svg">
</span>
<span class="jss941">
I Agree To The Terms
</span>
</p>
I have tried three different ways, but none of them is working:
//Tried with xpath clicking on image: Error: Element not interactable
driver.FindElement(By.XPath("//img[@src='/images/purple.svg']")).Click();
//Tried with Xpath by selecting the span
driver.FindElement(By.XPath("//span[@class='js122')]")).Click();
//Tried with CssSelector Error: Element not interactable
driver.FindElement(By.CssSelector("img[src*='purple.svg']")).Click();
Please help with any other workaround.