Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Select Dropdown value dynamically

DaltonDalton Members
edited August 2013 in Sahi - Open Source
Hi all,
I have a drop down which populates credit cards automatically when i added a credit card and hit refresh button,. I may have a zero,one or more credit cards at the time of adding new card
But i want to choose a card which is added (eighter first or last)

I used the below code

Browser().select("/r2:1:r1:1:r\\d:0:soc1/").choose("/\\*.*/");

but not working properly

Any alternative for this???????

Best Answer

  • you can use collect() api to collect all the values in the drop down into an array, so that you can select which ever value you want from the DropDown.

    eg:var $els = _collect ("_link", "/group 1/", _in(_div("div1")));
    you can also use count to count all the values from the dropdown using count() api
    var $c = _count ("_link", "/group 1/");
Sign In or Register to comment.