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.
_condition & _popup
Pleas help.
I have some text in a cell of a table... I wish to determine which table the text appears is.... I have this working for a non popup window, but when it comes to popup windows, I can't seem to find a solution.
The reason for doing this is that I am writing scripts along side my developers writing code, and every so often they change the layout and all my checks on cells fail!!!!
The code I am using is:
$text is the search string that I am looking for
$cell is used to pass the hardcoded table number in my popup window - this is the parameter I want to stop using
$row is the row I want to look in
$col is the column I want to look in.
Any help on this would be greatly appreciated.
Donna
I have some text in a cell of a table... I wish to determine which table the text appears is.... I have this working for a non popup window, but when it comes to popup windows, I can't seem to find a solution.
The reason for doing this is that I am writing scripts along side my developers writing code, and every so often they change the layout and all my checks on cells fail!!!!
The code I am using is:
function tableElements($popup, $text, $cell, $row, $col)
{
var $SearchCell = 999;
for (var $i=1; $i<99; $i++)
{
if ($popup == null)
{
if (_condition(_cell(_table($i), $row, $col) != null))
{
if (_condition(_cell(_table($i), $row, $col).className != "DisabledTabRounded"))
{
var $cellText;
_set($cellText, _cell(_table($i), $row, $col).innerText);
if ($cellText == $text)
{
$SearchCell = $i;
$i = 999;
}
}
}
}
else
{
$SearchCell = $cell;
$i = 999;
}
}
_assertNotEqual(999, $SearchCell, "Element not found in any table displayed");
return $SearchCell;
}
$popup is the name of the popup window, if I am not using a popup window then I pass in null.$text is the search string that I am looking for
$cell is used to pass the hardcoded table number in my popup window - this is the parameter I want to stop using
$row is the row I want to look in
$col is the column I want to look in.
Any help on this would be greatly appreciated.
Donna
Comments
In case of a popup, you will need to use _popup("pop name or ID") with the sahi APIs/methods/functions like:
_popup("pop name or ID")._cell(_table($i), $row, $col);
Regards,
Pankaj