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.

THat is problem

lokendralokendra Members
edited November -1 in Sahi - Open Source
how to call a varible in sahi. in loop like this
for (var $i=2; $i<5; $i++)
{
}
the values of i is numeric
_click(_link("$i"));
===============
_click(_link("2"));

Comments

  • var $linkName = new Array ("OneLink", "TwoLink", "ThreeLink");

    for (var $i=0 ; $i<$linkName.length ; $i++) {
    _debug ( $linkName[$i] ) ;
    _highlight(_link( $linkName[$i] ));
    _click(_link( $linkName[$i] ));
    }


    This works for me - Hope that helps.
  • Hi lokendra,

    Try this,

    for (var $i=2; $i<5; $i++)
    {
    _click(_link("" + $i));
    }
Sign In or Register to comment.