Welcome to the community! Register below to add topics and replies.

Please or Register to create posts and topics.

Randomize functions

We have created a new set of randomizer functions for random number generation, and to simulate random clicks and selections.

Random numbers

In order to generate a random number between 0-100, simply write


In similar fashion, to generate a number between 1000 and 1005, write


You can also exclude numbers. To generate a number between 1-10 but not 5 or 6, write


Random clicks

You can also use the randomizer to generate a random click. This can be used to generate a random selection between a number of options. Simply select a single element of the selectable elements, and make sure the common parent element is included in the path. Consider you want to select the filter in the following table


To exclude the "All species" link, simply add ":|All species".

LI:Contains(/{random:|All species}/)

If you instead want to click a random page, use the following selection

UL:near(all species lion zebra elephant)

Random selections in drop-downs

In order to randomly select something in a drop-down, you can also use this function. 

Look at the example

If we want to select between the options in the drop-down start by recording a selection of any element in the drop-down. Instead of modifying the element selector, simple change the "Value" to /{random}/.

Element selector (unchanged)

SELECT:near(Dropdown List)



When running this code, you can see that one-third of the time "Please select an option" is selected, which is problematic. Exclude this in a similar fashion

/{random:|Please select an option}/

We hope that this experimental feature can prove useful. By combining this feature with the powerful regex data generator we allow for automated tests that explore more paths in your applications, allowing you to find bugs related to edge cases.



Create your account for free!

Prefer a demo instead?