2

I am new to Selenium IDE. I want to do validations for the checkbox. I have tried the below code

<tr>
<td>mouseOver</td>
<td>name=viewIndex</td>
<td>356</td>

 <tr>
    <td>click</td>
    <td>name=viewIndex</td>
    <td>356</td>
</tr>

It is executing the result as

[info] Executing: |mouseOver | name=viewIndex | 356 |

But there is no progress on my webpage.

4
  • What is meant by "validations for checkbox"? Are you trying to see if a checkbox is present on the page, or are you trying to click on the checkbox itself?
    – SheyMouse
    Commented Oct 24, 2013 at 13:48
  • when i click at a check box, my selenium must say or should do select the particular check box i did Commented Oct 25, 2013 at 4:42
  • That is exactly what I need, but is there a Selenese method of doing that? I grabbed the status using a small script, but that's about the extent of my script knowledge.
    – Chris H
    Commented Apr 26, 2017 at 16:14
  • It might be worth asking your own question similar to this one to be sure to get the right tags and people looking at your question.
    – Swagin9
    Commented Apr 26, 2017 at 16:16

4 Answers 4

1

I would use Selenium Builder instead of Selenium IDE. If your script was exported as Java, then you just do this:

WebElement checkbox = driver.findElement( By,id('the_id' ) );
if ( checkbox.isSelected() ) {
  System.out.println("Checkbox was already selected: " + checkbox.toString() );
} else {
   checkbox.click();
}

I use this project template to run my Builder scripts.

0
0

I just used check in command for checking the particular value and uncheck for unchecking the value for it.

As my code goes below

<tr>
<td>check</td>
<td>loggerCheck</td>
<td></td>

<tr>
    <td>uncheck</td>
    <td>loggerCheck</td>
    <td></td>
</tr>
0

You can do something like...

if   |   !selenium.isChecked("my_checkbox")
   waitForElementPresent   |   name=my_checkbox
   click                   |   name=my_checkbox
   waitForValue            |   name=my_checkbox   |   on

The code above will check to see if the box is checked. If not, then it will check the box and verify that it's checked [on]. The only downfall to the method above is I haven't found a way to do this with a checkbox using anything except NAME or ID. I haven't gotten this to work using XPATH or CSS, which would help in the even that the box doesn't show a change in status [xpath] when you check/uncheck it.

0

First of all add plugin (.js file) to your Selenium IDE.

Go to menu Option > Options Upload on Selenium Core Extension slot (user-extension.js)

Second using the Gotoif and Label command. Full instruction here but change the "store" to "storeChecked" because you want to save the boolean of the checklist. The rest is same.

Hope this is helping!

1
  • This is 4 years back question & now technology has been moved from Selenium IDE to WebDriver, Grid, Selenium 2.0 & latest selenium 3.0. I think no one will be working on IDE the user who posted this question has already accepted the answer, so no need to check ....Hope this is helping!
    – Bharat Mane
    Commented Jul 25, 2017 at 6:58

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.