18 January 2026:


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.

Debug file in to an excel sheet

SamsirsameerSamsirsameer Members
edited November -1 in Sahi - Open Source
Hi,

Can you please provide me code for logging the debug messages to an excel file.

Currently Iam loging the messaages to a text file and the code used is

code:
EXAMPLE:
_if(_condition(_getText(_cell(_table(2), 3, 2)) == "Password:"))
{
_log("Password field is displayed", "success");
_debugToFile("TCS:LOGIN004 Password field is displayed PASSED", "C:\\sahi\\SAHIPROJECT\\Logs\\Log.txt");
}
else
{
_log("Password field is not displayed" , "failure");

_debugToFile("TCS:LOGIN004 Password field is not displayed FAILED", "C:\\sahi\\SAHIPROJECT\\Logs\\Log.txt");
}

File contents:
EXAMPLE:
TCS:LOGIN002 Page Title is displayed correctlty PASSED
TCS:LOGIN003 Inner Page Title is displayed correctlty PASSED
TCS:LOGIN004 User Name field is displayed PASSED
TCS:LOGIN004 Password field is displayed PASSED

But it woule be great and easy if we log these messages in an excel sheet with following columns
EXAMPLE:
TestCaseID Message Status
LOGIN004 Password field is displayed PASSED (cell should be in green color)
LOGIN005 Page Title is displayed correctlty FAILED (cell should be in red color)


Please reply.....

Thanks,
Samsirsameer

Comments

Sign In or Register to comment.