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.

Regarding Listbox

arunbalaarunbala Members
edited November -1 in Sahi - Open Source
hi,

I am just trying to get the items count in a listbox. And i have used _count. But i didnt get that one. Is it correct?

Thnx

Comments

  • nagarnagar Members
    Hi arunbala,

    Use this:
    _select("identifier").childElementCount

    for, getting item names:
    _getText(_select("identifier").children[index value])

    This might help you.

    Regards,
    nagar
  • Hi nagar,
    Am getting the error like Undefined for getting the items count. i dont know what i did.. here is my script

    var $count = _select("ctl00\$cphClientBody\$ddlCountry").childElementCount;
    _alert($count);
  • You could also try _select("id").options.length
  • Tnx its wrkn fine
Sign In or Register to comment.