18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
is it possible to get text of object without using _set()
Dear Sahi Team/ Users,
is it possible to get text of object without using _set() method
Example :
when im using "_debug($subReport[$j].text);" this its not displaying text instead its displaying like
_debug(String(_link("/./[0]", _in(_div("leftmenu2"))).text));
is there any other option to get/ display text without assign to "$arry_SubReport[$j]"
due to this its wasting of time in assigning to another variable again
is there any other alternate way to get/ display a text directly by using "$subReport[$j].text" variable
is it possible to get text of object without using _set() method
Example :
var $subReport = _collect("_link", "/./", _in(_div("body")));
var $arry_SubReport = [];
for (var $j=0; $j<$subReport.length; $j++) {
_set($arry_SubReport[$j], $subReport[$j].text);
_debug($subReport[$j].text);
}
when im using "_debug($subReport[$j].text);" this its not displaying text instead its displaying like
_debug(String(_link("/./[0]", _in(_div("leftmenu2"))).text));
is there any other option to get/ display text without assign to "$arry_SubReport[$j]"
due to this its wasting of time in assigning to another variable again
is there any other alternate way to get/ display a text directly by using "$subReport[$j].text" variable
Comments
try _getText(element)
regards
Wormi
thank you for your quick reply.
its also behaving like _set() only
until i assign value to variable by using _set() v cannot get actual text
actual code
Example
for this " _debug($arry_SubReport[$j]); " now it will display(sahi controller) actual text which is containing in " $subReport[$j].text " like
if i will use directly _debug() without assign a value by using _set() like below
now it will display(sahi controller) like
instead of actual text
can v get actual text which is existing under " $subReport[$j].text " without assining a value by using _set()
by usin " _getText(ele) " im getting same like _debug() value, as shown below
instead of actual text
actually it should be like "