Forum Discussion

mgroen2's avatar
mgroen2
Super Contributor
9 years ago

Execute teststeps in random order?

I have following situation, which leads to this question:

I use keyword testing, to fill some input fields, click on button, etc on a screen.

 

Question is: how can I make the order in which buttons are clicked/input fields are entered, etc, Random?

 

I can use while and for loops, etc, but I want to achieve random order of steering controls in a testcase?

Is this even possible with Keyword Driven testing alone? Or is scripting required?

 

Thanks for ideas, and tips.

4 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor

    I believe you would need to add a script to return the random number.

    I am not seeing any method in keyword tests to generate a random number.

     

    Previously asked here.

     

     

    • mgroen2's avatar
      mgroen2
      Super Contributor

      Ryan_Moran thanks for your answer and the link.

       

      I have created feature request to set out my thoughts of what I mean, and hoping it might be implemented in future TC release.

      It can be found here.

       

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1

    Hi Mathijs,

     

    I would agree with Ryan: this is not something that is supported out-of-the-box and needs to be implemented manually, depending on your given tested application.

    A possible approach is to create an array/dictionary that reference controls that will be interacted with, shift the elements randomly and iterate them than.

     

    P.S. The similar randomized approach may be implemented for several other actions: e.g. to enter data into control using keyboard (via .Keys() ) or pasting them from the clipboard (via .Keys("^V") ). Or select an item for the combo-box by clicking it or by selecting using arrow keys and pressing Enter. Open context menu with mouse right-click or by pressing Shift-F10. Etc.

    • mgroen2's avatar
      mgroen2
      Super Contributor

      AlexKaras maybe you can vote for the feature request, regarding this question?

      it can be found here.