In a webpage (HTML below) I have two radio buttons.

Neither of them are selected by default.

While trying to automate the click event on the button i got this error - "element not find".

I did set correct locator and also tried in many ways but I'm not able to click using automation.

this is design code

New contributor
ATRS is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    You should share your code. – Bence Kaulics Dec 8 at 11:16
  • 1
    Definitely need to see your code - I’m afraid we can’t just take your word that you set the correct locator. It also means we don’t waste time typing out something that you have already tried. – RossK 2 days ago
  • You've not responded with your code. Are you reading both buttons into an arraylist or are you using a more complex xpath using the sibling labels? I realize this was posted over the weekend, so some time delay can be expected, but please provide code or you'll start getting downvotes. – Bill Hileman yesterday
  • Hi all, this is my code for select radio option. WebElement rB1 = driver.findElement(By.id("MainContent_rdoTravelType_0")); ((JavascriptExecutor) driver).executeScript( "arguments[0].checked = true;", rB1); – ATRS yesterday

Your Answer

ATRS is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.