I have been trying for days to select this button... I've tried xpaths by ID type, input type, child of, etc. What am I missing here, why is VS unable to locate the "element" ? I can use the same command to ID and click a radio button on something such as FB or another site... (Bear with me, I'm newish to automation and making an attempt at self-teaching)

Message: OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":".//input[@id='q1_1']"} (Session info: chrome=80.0.3987.87)

  //radio button, if I can actually get this to work....

enter image description here


2 Answers 2


The xpath that you currently have will look for element with tag input and id q1_1 from the current node.


So , if you have executed some scripts and the current focus is on any tag after the input tag , then


will not return any element .

So instead of



"//input[@id='q1_1']"  // removed the dot at the starting

The above locator will look for input tag with the specified Id , starting from the root , unlike your case where it searched only from the current node.

  • I felt like I already attempted this way (Had to reboot so lost all my undos) But I tried again with the update. Same result "Message: OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//input[@id='q1_1']"}"
    – user43500
    Feb 6, 2020 at 20:31
  • @user43500 add explicit wait and check whether the element is in iframe
    – PDHide
    Feb 6, 2020 at 21:29
  • removing the dot(.) should work. If not try to implement WebDriverWait. Feb 7, 2020 at 13:50
  • Could you share the webpage URL? Feb 17, 2020 at 11:21

Please go through a Select class, it should work

 // Select By Class
  Select Radiobutton = new Select(driver.findElement(By.id("q1_1")));

Please go through type attribute, it also works


  • No luck still, whatever method I try, the radio button does not get selected and I get the return "Message: OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: " followed by the whatever action was used to attempt to locate the button.
    – user43500
    Feb 7, 2020 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.