Answered

Choose random dataset for execution set

Hi,

I could use an option to let the execution set randomly choose a dataset for a testcase instead of picking one.

usecase:
a testcase uses a dataset to choose from a list of testdata options where it doesn't really matter which one you choose (but you can't ranomise it in the testcase either because there are only specific data options (names, IDs,..) that you can choose from) and the test should rather randomize the exact testdata instead of you having to choose a different one every other day.

Selecting multiple/all datasets in the execution set would result in the testcase being run for every dataset entry instead of just choosing one of them per scheduled execution.

0
2 comments
Avatar
Joseph Hamdan

++Moving to General discussion

Hi Jonathan,

Thanks for creating a post. We will take a look at this and get back to you soon.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Jonathan,

We have imported a test case in your user named "random_dataset_picker". Here's how it works:

1. We generate the datasets into a list
2. We use Set_Var to count the number of rows in the list and determine a max number
3. We use a JavaScript snippet to generate a random number from 0 to the max number in step 2

function randomIntFromInterval(min, max) {
  return Math.floor(Math.random() * (max - min + 1) + min)
}
const rndInt = randomIntFromInterval(0, 10)
return rndInt


4. We navigate to an application and log in, then fill the email and password fields with random row numbers generated from step 3

PS: The fewer the datasets, the less randomness it generates.

Please let us know if you have any other questions.

Regards,
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.