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 select multiple values one by one

vikkyjainvikkyjain Members
edited September 2011 in Sahi - Open Source
Hi

I have two list boxs. One list box is having some items and another one is empty.
I dont know how many items are their in List1.when I select item from Listbox 1 and click on add button , then that item will be added to listbox 2. So i want to know how we can select multiple values , so that i can click add button only one time. or how to iterate through the list box values so that i can compare each value with my desired value and add it.

Listbox 1 may have more then 1 items which i need to add to list2.
CAn you please help me on this.

Comments

  • globalwormingglobalworming Moderators
    edited September 2011
    Hi vikkyjain

    to iterate over the listbox just use
    for ($i = 0 ; $i<_select("List1").options.length; $i++){
       //this will give you the item
       _log(_select("List1").options[$i].text);
    }
    

    pls tell me if this work :)
  • Hi,

    Thanks for your reply. I solved it one hour before after long R&D on this.
    I use the same way.
This discussion has been closed.