0

I am working on a project, where I have to catch the error message on radio button. When you submit the page or form, without selecting the radio buttons, it shows on top of radio button that 'please select one of the option' on radio buttons. The coding is

<Input type="radio" id="Never" value="100" name="physical_function2" required="">

I am able display "false" when radio button is not clicked with isSelected().

I tried switchTo().getText().But as its not an alert,it doesn't work.I can't inspect the message. Thanks

  • The coding is<input type="radio" id="Never" value="100" name="physical_function2" required=""> – TestingLearner Mar 21 at 17:12
  • I am not sure what you're asking about? Are you asking about how to display a message on a webpage? – Alexey R. Mar 21 at 17:33
  • 2
    Simulate the error manually, then examine the underlying HTML code. It's likely part of that page's DOM, you just need to know what locator to use to check to see if it's present or not. I'm guessing you mean that you want to check if the message is being displayed when it should be, not that you want to display a message. – Bill Hileman Mar 21 at 18:31
  • Hi,thanks for your reply and suggestion.For example there are 4 radio buttons and selecting 4 of them together is mandatory before submitting.When I click on any one of them and submit ,generates a message on another radio button to select it.But the message generated is not an alert,not a popup message and have no web element or locator in the entire code.So I can't use switchTo(),getText.And I can use isSelected for single radio button,but not on List <Webelement.> – TestingLearner Mar 24 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.