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.

access parent/child elements in a popup window

dkdk Members
edited November -1 in Sahi - Open Source
Hi

I want to access dynamic elements generated in a popup window.

I tried

_popup("PopWindow")._set(var $parent, _parentNode("DIV",_span($savedCt),2));

I have a known element _span($savedCt)
need to get all the child elements of this SPAN's parent.

For the above code getting error log as:
TypeError: Object doesn't support this property or method
No trace available

How can I solve this?


Thanks

Comments

  • narayannarayan Administrators
    Hi dk,

    It should be
    _popup("PopWindow")._set($parent, _parentNode("DIV",_span($savedCt),2));
    not
    _popup("PopWindow")._set(var $parent, _parentNode("DIV",_span($savedCt),2));
    

    Btw, don't use _set to get nodes. Use it to get text (using _getText) or value.

    If you want to work with nodes, look at browser tags and also _near and _in.

    Regards,
    Narayan
  • dkdk Members
    Thanks Narayan. Solved it by _near.
This discussion has been closed.