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.

Store values from a select box

tejas269tejas269 Members
edited November -1 in Sahi - Open Source
Hello,
I am writing testcases using sahi 4.2 excel framework
I want to check if all the values in a select box from one page are displayed as labels on the other page.

the script i have written is
function myFunction(){
    _click(_link("Link 1"));
    
    $arr= [];
    var $opt= _select("mySelect").options;
    for(var i=0; i< $opt.length; i++){
      $arr[i] = opt[i].text;
    }
    
    
    _click(_link("Link 2"));
    
    for(var i=0; i< $arr.length; i++)
    {
        _assertExists(_label($arr[i]));
    }        
}

but when I run the script, only the click link statements are executed and success message is shown
Sign In or Register to comment.