Forum Discussion

matthew_morgan's avatar
matthew_morgan
Occasional Contributor
10 years ago

Change attributes on the current Folder in the log

I am trying to change the attributes on a folder based on if there are any error messages within that folder. I was wondering if this was possible.  For example:

 

[code]

var goodAttr = Log.CreateNewAttributes();

goodAttr.Bold = true;
goodAttr.BackColor = clLime;
goodAttr.FontColor = clGreen;

 

var badAttr = Log.CreateNewAttributes();

badAttr .Bold = true;
badAttr .BackColor = clRed;
badAttr .FontColor = clMaroon;

 

foo = function()

{

    var previousErrs = Log.ErrCount;

 

    var logFolder = Log.CreateFolder("New Folder", "Stuff that goes in this folder", pmNormal, goodAttr);
    Log.PushLogFolder(logFolder);

 

 

    // ...

    // Do Stuff

    // Some of which may be errors

    //...

 

    if (Log.ErrCount > previousErrs)

    {

        // This is the part I can't figure out.

        Log.Item(logFolder).Attr = BadAttr;

    }

    Log.PopLogFolder();

}

[/code]

  • Hi Matthew,

     

    There's currently no way to change the style of existing log messages and folders. You can only style them at the time of posting them.

    Feel free to submit a feature request here:

    TestComplete Feature Requests

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Matthew,

     

    There's currently no way to change the style of existing log messages and folders. You can only style them at the time of posting them.

    Feel free to submit a feature request here:

    TestComplete Feature Requests

    • matthew_morgan's avatar
      matthew_morgan
      Occasional Contributor

      Thanks. I thought that might be the case, but I wanted to make sure.