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.
Can not get the random number, please help!
Hi all,
I want to get a random number based on the size of the row of
one table, I write following script but it does not work, anybody can
help!
var $recordNo = _table(7).rows.length;
var $tickNo = _random(Number($recordNo));
_alert($recordNo); //13
_alert(typeof($recordNo)); //number
_alert($tickNo.valueOf()); //NaN
_alert(typeof($tickNo.valueOf())); //number
Thanks a lot!
I want to get a random number based on the size of the row of
one table, I write following script but it does not work, anybody can
help!
var $recordNo = _table(7).rows.length;
var $tickNo = _random(Number($recordNo));
_alert($recordNo); //13
_alert(typeof($recordNo)); //number
_alert($tickNo.valueOf()); //NaN
_alert(typeof($tickNo.valueOf())); //number
Thanks a lot!
Comments
I hope you understand that the parameter passed to _random, specifies the maximum value that _random will return.
Regards,
Narayan
I understand the meaning of the parameter passed to the _random function, thanks your kindly remind!