Forum Discussion

Nico's avatar
Nico
Occasional Contributor
4 years ago

Value From Set doesn't generate random value

Hi

 

Not sure if I'm using this wrong, or I stumbled onto an error.

 

I've got a Data generator step which creates an accountType.

Settings are as follows:

 

Property Type: Value From Set

 

Custom values:

abc

def

 

Generation Mode: random

 

Duplicate each value: disabled

 

Whenever I test this, even with 20 rows, all I get is abc.

 

If I set generation mode to Sequential, abc and def are alternating as expected.

 

For my test I just generate 1 line at a time, and I need this to be a random selection between abc and def.

 

Cheers

 

Edit:

If I add a third value, eg. ghi to the custom value set, the script now selects one of the first 2 values at random, ie. abc or def.

Is this possibly a bug in ReadyAPI where the Date Generator doesn't understand the range of the array?

5 Replies

  • Nico :

     

    Refer below screenshot, i have tried the same way it is working for me. Hope you have selected the "randomize selection of values" checkbox at the bottom.

     

     

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you for going ahead and checking this, Himanshu!

       

      Nico Did you manage to solve this? Was it the checkbox at the bottom?

       

       

    • Nico's avatar
      Nico
      Occasional Contributor

      Hi HimanshuTayal and sonya_m 

       

      Thanks for the reply, and sorry about my late reply (I was home sick).

       

      I double-checked and I do have Random generation enabled.
      I've attached a scrshot to show my experience better.

       

      This is in ReadyAPI 3.3.0, but I just came back to work and found a v3.3.2 ready for download, so I'll give that a try.

       

      Cheers,

      Nico

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Nico , I hope you are feeling much better now!🙂

         

        Yes, updating to 3.3.2 would be a great idea. Please let us know how this works for you.