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.
Number of rows and columns in a webtable
Hi All:
I am new to using Sahi and I am having some problems accessing the DOM. I did look at the post Number of rows and columns in a webtable by vazid and tried to execute the code.
CODE:
<browser>
// Since this needs to execute on the browser, use the browser tags around it.
function getRowLength(){
var Rows = document.getElementById('_table(1)').getElementsByTagName('tr');
var RowCount = Rows.length;
return RowCount;
}
</browser>
var $len = 0;
_set($len, getRowLength());
_debug($len);
In the statements I recieve
_setGlobal('\$len', getRowLength()); // comes up several times before --Stopped Playback: FAILURE--
Not sure what I am doing wrong here. Any help would be much appriciated.
Thanks
Ken
I am new to using Sahi and I am having some problems accessing the DOM. I did look at the post Number of rows and columns in a webtable by vazid and tried to execute the code.
CODE:
<browser>
// Since this needs to execute on the browser, use the browser tags around it.
function getRowLength(){
var Rows = document.getElementById('_table(1)').getElementsByTagName('tr');
var RowCount = Rows.length;
return RowCount;
}
</browser>
var $len = 0;
_set($len, getRowLength());
_debug($len);
In the statements I recieve
_setGlobal('\$len', getRowLength()); // comes up several times before --Stopped Playback: FAILURE--
Not sure what I am doing wrong here. Any help would be much appriciated.
Thanks
Ken
Comments
Thank you