Forum Discussion

Mounirb31's avatar
Mounirb31
New Contributor
4 years ago
Solved

How i can select a random element from a list in Desktop application

Hi everybody,   I want to select a random element in a list with testcomplete in desktop application but i don't know how to make this, Someone can help me please ?  
  • Wamboo's avatar
    4 years ago

    Hi,

    In my opinion everything depends on the function that selects a random element.

    The algorithm can look like this:
    1. read all grids values
    2. add them to e.g. an array
    3. use the function to select a random element from the table
    4. click on the -> item to search again in the object

    The 'random' function in JS:

    https://stackoverflow.com/questions/5915096/get-a-random-item-from-a-javascript-array