Forum Discussion
shankar_r, should I just be placing the codes/script on Automation Execution Report - Ready to Go on top of my tests? Let's say I have an existing test, I can just create a new test call the script containing the ones you coded, then run my existing ones. Is that how I am to use it? (pardon my noob questions, I don't have any coding background and is not using any codes on my tests)
This needs some re-visit on your code. But below item will give you the some idea how to configure
1) You add the ReportingFunctions.js[available in the thread] into your existing project as a script unit.
2) You insert the below lines of code in corresponding event [more about events handlers refer here]
In OnStartTest event ReportingFunctions.setLogsPath("C:\\AutomationLogs\\") ReportingFunctions.setExecutionStartTime(aqDateTime.Time()) ReportingFunctions.setTestCaseExeStartTime(aqDateTime.Time()) ReportingFunctions.fn_createtestcasedescription("Module1","YourTestCaseID","YourTestCaseDescription","YourEnvironment"); In OnLogCheckpoint event function GeneralEvents_OnLogCheckpoint(Sender, LogParams) { ReportingFunctions.fn_createteststep(1,LogParams.MessageText,LogParams.MessageText,LogParams.AdditionalText,false); } In OnLogError event function GeneralEvents_OnLogError(Sender, LogParams) { ReportingFunctions.fn_createteststep(0,LogParams.MessageText,LogParams.MessageText,LogParams.AdditionalText,false); } In OnLogEvent event function GeneralEvents_OnLogEvent(Sender, LogParams) { ReportingFunctions.fn_createteststep(3,LogParams.MessageText,LogParams.MessageText,LogParams.AdditionalText,false); } In OnLogMessage event function GeneralEvents_OnLogMessage(Sender, LogParams) { ReportingFunctions.fn_createteststep(3,LogParams.MessageText,LogParams.MessageText,LogParams.AdditionalText,false); } In OnLogWarning event function GeneralEvents_OnLogWarning(Sender, LogParams) { ReportingFunctions.fn_createteststep(2,LogParams.MessageText,LogParams.MessageText,LogParams.AdditionalText,false); } In OnStopTest function GeneralEvents_OnStopTest(Sender) { ReportingFunctions.setTestCaseExeEndTime(aqDateTime.Time()); ReportingFunctions.fn_createtestcaseduration(); ReportingFunctions.fn_completetestcase(); ReportingFunctions.setExecutionEndTime(aqDateTime.Time()); ReportingFunctions.fn_generatehighlevelreport(); }
Then run your test, you will be able to see the HTML reports
- XBug7 years agoContributor
shankar_r, I tried going through your instructions. I was able to add the Reporting Functions as a new script on my existing test. I tried importing but was having difficulties so I decided to go by copying the contents instead. Then as I was adding the Event Handlers, I was stopped on the first one - OnStartTest - see OnStartTest.png. Only one (1) handler can be added and I was only able to add the first one. Then I tried adding the Event handler for the OnLogCheckpoint but the function fn_createteststep does not appear on the list of available tests/functions, see OnLogCheckpoint.png.
Please advise on what I might be missing
- shankar_r7 years agoCommunity Hero
Hi,
Those functions should be called inside the Event handlers not as event handler trigger function.
Instead of assigning setLosgPath function Event handler section, Just create a default event handler function and then inside that function add the functions i mentioned in the previous post
Related Content
- 4 years agosdas