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.

how to extract all values in a select box

shamsham Members
edited November -1 in Sahi - Open Source
Hi all,

Is it possible to extract or list out all the values present within a text box.
I mean I dont want to list out only the current value present in the selectbox but I want to get all the available values in that select box as well.

Is it possible?

Comments

  • Hi Sham,

    Yes, we can extract the values from select box(list box), Please use the below code

    //Count the items in list box
    $Options = _select("/./").length;
    _set($Options, _select("/./").length);.
    _alert($Options);
    for($i=1; $i <$Options; $i++)
    {
    _alert(_select("/./").options[$i].text);
    }


    Code will work out


    Regards
    Raja
Sign In or Register to comment.