TestProject Forum
Powered by leading experts in the test automation community

Click random/all checkbox

Hi,
Is there a way to check the checkboxes randomly or to select all checkboxes in test recorder?

Hello @svamsikrishna532, thanks for reaching out.

as we talked over zoom, you can click on a random checkbox by performing the following:

  1. count the number of the checkboxes using the “Count Elements” action and save the output into a parameter, for example:

  1. generate a random number in a range of 1- num_of_checkboxes (the parameter you just created) using “Random number in a range” action, for example:

  2. using the generated random number, use it as an index of the checkboxes array and perform a “click” action, for example:

image

running these three steps in a sequence will click on one of the checkboxes randomly

an add-on to click on all checkboxes in a single step will be released in the next coming day.

Thanks much, Meidan :+1:
Also, this would be great if possible include the below features like-

  1. Select multiple checkbox in a single test step
  2. Select alternate checkbox
  3. Select first n number & last n number checkbox
  4. Select all checkbox .
    Could please update here ones the addon is ready.

Hey @svamsikrishna532,
“Checkboxes Operations” Addon is just released and now available in Addons page

you can install it and use the actions provided by this addon to manipulate lists of checkboxes

image

by the way, you can use “Click on N Checkboxes Randomly” with N set to 1 for the first question you asked above.