18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Random listbox
Hi,
Am having a list box contains some values. While executing the scripts i wants to select a value randomly. Is there any methods available for it?
Thnx
Am having a list box contains some values. While executing the scripts i wants to select a value randomly. Is there any methods available for it?
Thnx
Comments
you can use the _collect api and http://lmgtfy.com/?q=javascript+random
Regards
Wormi
I didnt get this link. pls look into that
For going a little bit deeper into this: Think about what elements should be accessed randomly, then use the _collect API to store these elements in an array. Then create your random index with Math.random like it has been done here (source: http://www.naden.de/blog/zufallszahlen-in-javascript-mit-mathrandom)
Regards
Wormi