user199354
user199354

Reputation: 505

Selection of Radio Button-Selenium IDE

I am new to Selenium IDE and need help in selection of radio buttons here. In my case, I am trying to generate a test case for a particular form consisting of radio buttons. When I run the command to select one of the radio buttons singly, the function works but if I run the whole test case then the radio button do not get selected and gives error of Element Id not found. Here is my html:

<input type="radio" value="0" id="ProjectSolutionsProject0" name="data[Project][solutions_project]">

My IDE command: click Target:id=ProjectSolutionsProject0 . I tried verifyByValue , assertValue but nothing is working. Please help

Upvotes: 0

Views: 4342

Answers (1)

John
John

Reputation: 286

From what you are describing, it appears the element may not be ready quite yet when you are trying to run the step. I have found that if an element is being dynamically generated it may take it longer to show up than Selenium wants to wait. There is a few ways to possibly fix this:

  1. Use the waitForElementPresent command where id=ProjectSolutionsProject0 right before your current one to ensure that element has time to load.

  2. Whatever command before that try changing it to a ...AndWait command instead to give the page time to load

  3. Lastly you could try the waitForPageToLoad command right before this command and see if that allows the page to fully load first.

I recommend trying those options in that order to see which one would solve your problem.

Upvotes: 3

Related Questions