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.

_popup list control length

DonnaMooresDonnaMoores Members
edited November -1 in Sahi - Open Source
One of my team members has found the following problem
var $listcount = 0;
_set($listcount,_popup("DomainMembers")._select("ListMembers").length);
$listcount is never set to the correct value.

We have tried moving "_popup("DomainMembers")._select("ListMembers").length" into a function, but with no luck

Any suggestions.

Cheers
Donna

Comments

  • hi,

    What are the expected and actual results after executing this code?

    Pankaj.
  • The error message I am getting is:
    _sahi.handleSet('\$length' + 39, _popup("DomainMembers")._select("ListMembers").length); SyntaxError: Expected ')'
    No trace available
    
    I was expecting that $length would be set to 36! I can not get the "_popup("DomainMembers")._select("ListMembers").length" to ever return a value, yet if I use the Sahi controller I can see that the value is 36.

    Cheers
    Donna
  • pankaj.nithpankaj.nith Members
    edited August 2008
    Hi,

    I am not sure but try using the code below and lemme know if it helps..
    function getLength(){
        return _popup("DomainMembers")._select("ListMembers").length;
    }
    
    var $listcount = 0;
    _set($listcount, getLength());
    _alert($listcount);
    
    Regards,
    Pankaj.
  • DonnaMooresDonnaMoores Members
    edited August 2008
    Changing my script as you have suggested gives me the following error in my output log
    _sahi.handleSet('\$listcount' + 18, getLength()); SahiNotMyWindowException: SahiNotMyWindowException
    No trace available
    
    However I have found that if I preceed your _set and _alert commands with _popup($name). then I get the value 0 in an alert.....

    Also

    _popup("DomainMembers")._set($listcount, getLength());
    (1) _popup("DomainMembers")._alert($listcount);
    (2) _popup("DomainMembers")._alert(_select("ListMembers").length);

    (1) has a value of 0 in the alert box
    whereas
    (2) has a value of 36 as expected in the alert box....

    but I really need to store this value into a variable

    Any more suggestions will be greatly appreciated, in the meantime I will continue..

    Thanks
    Donna
Sign In or Register to comment.