18 January 2026:


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 Wait times ?

KMANDOKMANDO Members
edited March 2009 in Sahi - Open Source
Anyone know of how I could implement a random wait time ?

looking for random times between 1 sec and 9 sec.

tried the following without luck

_wait(_random(1000));

Comments

  • narayannarayan Administrators
    _wait((_random(8)+1)*1000) should do it.

    _random(limit) returns any number between 0 and limit.
    Since you want from 1 to 9, use _random(8) to generate numbers from 0 to 8, add 1 so that it becomes 1 to 9, and then multiply by 1000 for milliseconds.

    Regards,
    Narayan
Sign In or Register to comment.