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.
Unable to fetch data from Table
Hi,
I had written a function to get data from a table.
So I make a demo function to iterate thru table.
"sahi_fileSelectionTable" is id of my table.
Total number of rows = 2 in my table.
When i use "alert(rows.length)" it gives 2
but when i use " alert(rows.length+"");" it gives me "_sahi._table("sahi_fileSelectionTable").rows.length"
Please help me, its not going thru the loop.
function getData()
{
table1 = _table("sahi_fileSelectionTable");
rows = table1.rows;
alert(rows.length);
alert(rows.length+"");
for(var i=0;i< rows.length;i++)
{
alert(i);
}
}
Thanks
Vikky
I had written a function to get data from a table.
So I make a demo function to iterate thru table.
"sahi_fileSelectionTable" is id of my table.
Total number of rows = 2 in my table.
When i use "alert(rows.length)" it gives 2
but when i use " alert(rows.length+"");" it gives me "_sahi._table("sahi_fileSelectionTable").rows.length"
Please help me, its not going thru the loop.
function getData()
{
table1 = _table("sahi_fileSelectionTable");
rows = table1.rows;
alert(rows.length);
alert(rows.length+"");
for(var i=0;i< rows.length;i++)
{
alert(i);
}
}
Thanks
Vikky
Comments
If you wish to iterate over a DOM variable, you need to first use _set to take a snapshot of that variable and then use it in the loop.
Try this:
Refer this for more details.
Regards,
dkulkarni
ITs working fine, thanks for your quick response.
My problem is solved successfully.
Thanks
Vikky Jain