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.
sahi not holding jquery objects
hi ,
I tried to use jQuery to retrieve elements , stored them into an array and again used jquery (OR sahi script) to get values of objects in that array. Sahi shows length of array correctly, but when I tried to retrieve each object in that array, I get null object.
var $sCount = new Array();
_set($sCount,$("#divArea").children().children(".spanchildclass"));
_alert($sCount.length); //here I get correct count of objects
for(var $i=0; $i< $sCount.length; $i++ ) {
var $sText;
_set($sText, $($sCount[$i]).text()); //each object in that array shows as null.
_alert($sText);
}
How can I make it work?
Thanks
I tried to use jQuery to retrieve elements , stored them into an array and again used jquery (OR sahi script) to get values of objects in that array. Sahi shows length of array correctly, but when I tried to retrieve each object in that array, I get null object.
var $sCount = new Array();
_set($sCount,$("#divArea").children().children(".spanchildclass"));
_alert($sCount.length); //here I get correct count of objects
for(var $i=0; $i< $sCount.length; $i++ ) {
var $sText;
_set($sText, $($sCount[$i]).text()); //each object in that array shows as null.
_alert($sText);
}
How can I make it work?
Thanks
Comments
Sahi will not be able to store DOM objects like that (Sahi serializes the object and sends it to the proxy. This won't work for DOM objects). I would suggest you build a browser function to get all the text in an array, and then use it.
Regards,
Narayan
Thanks a lot Narayan. I will try this.
I couldnt make this work.array returned null. So I tried, _set($sCount,$("#divArea").children().children(".spanchildclass").text()); which in turns returned correct texts, but without a delimiter. I have an alternate solution with javascript, for the time being I am using it .
Thank you very much for looking into this.