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.
Problem in clicking a particular Link out of a list in a Table
I am trying to click a particular link in a HTML table (dtgLeaveRequest) named View.
I have to first search for the entry in the table that needs to be Viewed.
I am not able to uinderstand how to do that. This table has pagination and also almost 100 records.
Below is the code that I developed after lot of research which is working in Sahi Recorder when I click Test button.
But the same thing when I paste it in the script and do playback it doesn't works at all.
Can anybody help me out.
I have to first search for the entry in the table that needs to be Viewed.
I am not able to uinderstand how to do that. This table has pagination and also almost 100 records.
Below is the code that I developed after lot of research which is working in Sahi Recorder when I click Test button.
But the same thing when I paste it in the script and do playback it doesn't works at all.
Can anybody help me out.
var $table1 = top.frmContent.document.getElementById("dtgLeaveRequest");
_debug($table1 );
var $i = 0;
var $j = 0;
for ($i=1; $i<$table1.rows.length -1; $i++)
{
if($table1.rows[$i].cells[2].innerHTML == "11 Jul 2008")
{
_debug($table1.rows[$i].cells[2].innerHTML);
$j = $i - 1;
_debug($j);
}
}
_debug($j);
_debug("View["+$j+"]");
_click(_link("View["+$j+"]"));
_debug($j);
Comments
What is the error generated by Sahi Playback in "Statement" section ? is it --STOP Playback : SUCCESS-- without any other lines ?
What error does it give?
Try this:
var $table1;
_set($table1, top.frmContent.document.getElementById("dtgLeaveRequest"));
Regards,
pankaj.
And in the Sahi Log errors are : 1. TypeError: 'top.frmContent.document' is null or not an object
and sometimes 2. TypeError: 'rows' is null or not an object