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 syntax issue

vazidvazid Members
edited November -1 in Sahi - Open Source
I had issue with the popup to get the elements in it using this statement
_setGlobal("len",(_popup("popupname").document.getElementById("tableid").getElementsByTagName("TR").length));

If i execute then the error im getting is

_setGlobal("len",_popup("popupname").document.getElementById("tableid").getElementsByTagName("TR").length); SyntaxError: missing ) after argument list
()at:0
eval("_sahi._setGlobal(\"len\",_sahi._popup(\"Messages\")")at:0
()at<my webpage id>/_s_/spr/concat.js:2250
at<my webpage id>/_s_/spr/concat.js:2192


Please let me know wat am i doing wrong in the above syntax?

Rgds

Comments

  • Get the element and then set the global variable in a different statement.
  • vazidvazid Members
    Hey thank you for the reply,

    Could i know how do i get the elements of popup, in my above post i've been trying to retreive the elements from a popup

    Rgds,
  • Are the elements not identified by the Sahi controller when you record?
  • narayannarayan Administrators
    Use:
    _popup("popupname")._setGlobal("len", document.getElementById("tableid").getElementsByTagName("TR").length);
    
    The behaviour you report is a bug in Sahi.
  • Mystery solved.
  • vazidvazid Members
    Hey Thank you very much...this solved my query :)
Sign In or Register to comment.