I need to change coloue of Log.AppendFolder(ProjectName) based on the result. If Project Executin is Pass then I want Log.AppendFolder(ProjectName) to be in Green colour else in Red colour.
Now since Log.AppendFolder(ProjectName) is been created first and I come to know of the result after the execution only so how can I go back in the result log shet and change the colour of Log.AppendFolder(ProjectName) ?
Colors of the entries in the log that has already been created cannot be changed. As an alternative, you can implement the OnStopTest event handler in which you can check whether an error occurred during the test run and call Log.AppendFolder with necessary parameters. Here is an example:
<font class="small">Code:</font><hr /><pre>
Set LogAttr = Log.CreateNewAttributes
ErrCount = Log.ErrCount
If ErrCount > 0 Then
LogAttr.BackColor = clRed
LogAttr.BackColor = clGreen
Call Log.AppendFolder(Project.FileName, "", pmNormal, LogAttr)