Not able to identify the checkbox element ::before and ::after in Selenium

31 Views Asked by At

enter image description here I want to click on the checkbox. Tried different methods. But not working. Any solution?

@FindBy(xpath="//label[@for='Tnc']") Still its not getting the exact element of check box. Instead it is clicking on the Terms and Coniditions hyperlink and opening the pop up page. I wanted to click on the Chcekbox.

1

There are 1 best solutions below

1
KunduK On

Use following xpath to identify the element, which is checkbox element.

@FindBy(xpath="//input[@id='Tnc']")