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.
I want to loop through all items in a selectbox
May i know why this is not returning values.
var $all_Links = _collect("_Selectbox", "/./", _in(_div("searchDiv")));
var $all_Links = _collect("_Selectbox", "/./", _in(_div("searchDiv")));
Comments
Try using :
var $all_Links = _collect("_select", "/./", _in(_div("searchDiv")));
Also, have a look at collect.sah script by navigating to
sahi-home/userdata/scripts/demo/collect.sah
Regards
Smrithi
To loop through all the items in the selectbox, use something like,
_collect API is used to collect all the elements of same type(eg.,link,selexbox) in the webpage and with your script, it wont collect all the options in the select box.
Regards,
Theeran.
I got the solution from Smrithi, thanks a lot.
Regards,
Suputhra