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.
count the number of options in a select list.
My post with regard to retrieving the number of options in a select was deleted.
Can anyone please repost it.
Here's my select code:
<select name>
<option>dog</option>
<option>cat</option>
<option>rat</option>
</select>
i want to get the number of options it has.
Thanks a bunch!
Can anyone please repost it.
Here's my select code:
<select name>
<option>dog</option>
<option>cat</option>
<option>rat</option>
</select>
i want to get the number of options it has.
Thanks a bunch!
Comments
Try this code...
Hope this works for you.:)
Regards,
Pankaj.
<option>dog</option>
<option>cat</option>
<option>rat</option>
</select>
another question though, really forgot to mention this...
how do I assert if cat is on the options?
i tried this..
var $total = getcount(top.document.getElementById('animal'));
for (var $ctr=0; ctr<$total; $ctr++)
_assertEqual(_option(_select("animals"), top.document.getElementById('animal').options.value[$ctr] ), "cat");
Try if this helps:
You can use the function the way you want it.
Have a nice day!
Regards,
Pankaj.
Could you please help me out in choosing the Frame Work for a web based application.I am planing to automate using SAHI tool.
Thanks
Deepak