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.
clear the content of _lastAlert()
I have written below mentioned code but I want to clear the content of last alert.
Please help
function navigateToGroup($GroupName, $Description)
{
//Login to the Plant Connect
_setValue(_textbox("loginname"), "SuperUser");
_setValue(_password("password"), "SuperUser");
_click(_submit("Submit"));
_click(_image("admin.gif"));
_wait(3000);
//Open Site Admin>Group Page
_popup("Admin")._click(_link("Group"));
_popup("Admin")._click(_link("Add[1]"));
_popup("Admin")._setSelected(_select("groupType"), "Group1");
// Get the DB instance
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=D:\\Sahi_New\\scripts\\test.xls","","");
var $rs;
var $rs = db.select("select * from [Sheet1$]"); // Name of the Sheet
var $rs2;
var $rs2 = db.select("select * from [Sheet2$]"); // Name of the Sheet
var $cls = "null";
// Group Name Validation
for ($i=0; $i<$len; $i++)
{
var $GroupName =($rs[$i]["GroupName"]); // Name of the column
var $Description =($rs[$i]["Description"]); // Name of the column
if($GroupName == "null")
{
$GroupName="";
}
_wait(3000);
_popup("Admin")._setValue(_textbox("groupNm"), $GroupName);
_popup("Admin")._setValue(_textarea("description"), $Description);
_popup("Admin")._click(_submit(" Save "));
for ($j=0; $j<3; $j++)
{
var $Errors =($rs2[$j]["Errors"]); // Name of the column
_assertEqual($Errors, _lastAlert());
}
_set($cls, _lastAlert());
_popup("Admin")._setSelected(_select("groupType"), "Group1");
_wait(2000);
} //End of function
}
//Process Group Name Validation
$len=6;
var $excelTab= "[Sheet1$]";
navigateToGroup($excelTab);
Please help
function navigateToGroup($GroupName, $Description)
{
//Login to the Plant Connect
_setValue(_textbox("loginname"), "SuperUser");
_setValue(_password("password"), "SuperUser");
_click(_submit("Submit"));
_click(_image("admin.gif"));
_wait(3000);
//Open Site Admin>Group Page
_popup("Admin")._click(_link("Group"));
_popup("Admin")._click(_link("Add[1]"));
_popup("Admin")._setSelected(_select("groupType"), "Group1");
// Get the DB instance
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=D:\\Sahi_New\\scripts\\test.xls","","");
var $rs;
var $rs = db.select("select * from [Sheet1$]"); // Name of the Sheet
var $rs2;
var $rs2 = db.select("select * from [Sheet2$]"); // Name of the Sheet
var $cls = "null";
// Group Name Validation
for ($i=0; $i<$len; $i++)
{
var $GroupName =($rs[$i]["GroupName"]); // Name of the column
var $Description =($rs[$i]["Description"]); // Name of the column
if($GroupName == "null")
{
$GroupName="";
}
_wait(3000);
_popup("Admin")._setValue(_textbox("groupNm"), $GroupName);
_popup("Admin")._setValue(_textarea("description"), $Description);
_popup("Admin")._click(_submit(" Save "));
for ($j=0; $j<3; $j++)
{
var $Errors =($rs2[$j]["Errors"]); // Name of the column
_assertEqual($Errors, _lastAlert());
}
_set($cls, _lastAlert());
_popup("Admin")._setSelected(_select("groupType"), "Group1");
_wait(2000);
} //End of function
}
//Process Group Name Validation
$len=6;
var $excelTab= "[Sheet1$]";
navigateToGroup($excelTab);