Publish Error Logs if error occurs
In my test scenario, if the number of checkpoints has passed then that test case passes.
In case there is an error, I would like to publish that error to an excel file.
Note: Here writing to the file is not the question, but obtaining the error message based on count of error messages is required.
Please have a look at the below code-
<font class="small">Code:</font><hr /><pre>
str1 = "123"
if str1 = "456" then
log.Error("Error occured") ' Error Message
strchkpointcount = log.CheckpointCount
If StrComp(strchkpointcount, "1") then
'This function puts Test Results in excel file.
log.Message("Test Case FAILED !!")
' Display the above error message here - Save it in a file - There can be multiple error messages
' Need to display each based on index or any other ways
Re: Publish Error Logs if error occurs
Handle the OnLogError event in your project. This will allow you to capture errors and save their text. See the "Handling Events" and "OnLogError Event" help topics.