Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
hp20712
Posts : 1
Join date : 2010-08-02

How to click random checkbox Empty How to click random checkbox

Tue Aug 03, 2010 9:46 am
Hi all,

Currently I am learing about selenium IDE. I have problem with a testcase please help me!
In my screen has list of checkboxes. User can select more than one checkbox.
I record all steps of this testcase but when playback it I want to select random checkbox.
So What's command to select random checkbox?
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to click random checkbox Empty Re: How to click random checkbox

Sat Aug 07, 2010 12:09 pm
hi,

There is no way to get select the random id in selenium IDE directly. You have to write javascript code for it which is a bi task for beginner level.

What you can do it to provide checkbox locator in you script according to your need every time you run script.

If you want to want to do it programatically:

1. store all checkbox locator into an array.
2. calculate the length of array.
3. pass that length into random function.
4. whatever random number you get , select that element.

Best of luck.

bye
Back to top
Permissions in this forum:
You cannot reply to topics in this forum