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.
Updating result back to excel sheet
Hi,
The below part of code checks whether any of the test flow (functions) for the test one test case has failed, if the counter for failure is more than 0 then one of the function executed for particular test case has failed, then the entire test case has to be marked failed. When control comes here the _alert attempted in this code provides correct results like there are no failure (if no failure off-course) and greater than 0 if failed. And the update query in the _alert() also looks good however it is not updating the excel sheet. (my MSoffice is of 2003 format).
Can someone assist me updating the test result back to excel. or if do you find any errors in the script written, please let me know.
The below part of code checks whether any of the test flow (functions) for the test one test case has failed, if the counter for failure is more than 0 then one of the function executed for particular test case has failed, then the entire test case has to be marked failed. When control comes here the _alert attempted in this code provides correct results like there are no failure (if no failure off-course) and greater than 0 if failed. And the update query in the _alert() also looks good however it is not updating the excel sheet. (my MSoffice is of 2003 format).
Can someone assist me updating the test result back to excel. or if do you find any errors in the script written, please let me know.
_alert($Failurecnt);
var DriverDBUpdate = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=D:\\BITS\\HP\\Test_Data\\FromFMRM_TestCases.xls;readOnly=false", "", "");
var $DriverRSUpdate = [];
if ($Failurecnt > 0)
{
_alert($DriverRSUpdate[$TcCnter][0]);
_alert("update [TestFlow$] set Status=Fail where TC='"+$DriverRSUpdate[$TcCnter][0]+"'");
DriverDBUpdate.update("update [TestFlow$] set Status=Fail where TC='"+$DriverRSUpdate[$TcCnter][0]+"'");
}
else
{
_alert($DriverRSUpdate[$TcCnter][0]);
_alert("update [TestFlow$] set Status=Pass where TC='"+$DriverRSUpdate[$TcCnter][0]+"'");
DriverDBUpdate.update("update [TestFlow$] set Status=Pass where TC='"+$DriverRSUpdate[$TcCnter][0]+"'");
}
}
This discussion has been closed.
Comments
should be
Status='Pass'