Priority Property

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Use the Priority property to specify the priority of the posted message. TestComplete uses a specific style (background color, font color, and font style) for each priority. If the Priority value differs from 100, 200, 300, 400 and 500, TestComplete treats it as a tag.

Declaration

LogParamsObj.Priority

Read-Write Property Integer
LogParamsObj An expression, variable or parameter that specifies a reference to a LogParams object

Applies To

The property is applied to the following object:

Property Value

The property can take on one of the following values:

  • pmLowest = 100
  • pmLower = 200
  • pmNormal = 300
  • pmHigher = 400
  • pmHighest = 500

Example

The code below demonstrates how you can use the LogParams object to specify settings for the messages posted to the test log when an unexpected window appears.

JavaScript, JScript

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)
{
  LogParams.MessageText = "An unexpected window has appeared.";
  // Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " + Window.Name + " window has appeared.";
  // ...
  LogParams.Priority = pmHighest;
  LogParams.FontStyle.Bold = true;
  // ...
  // Specifies the color settings
  LogParams.FontColor = clSilver;
  LogParams.Color = clFuchsia;
}

Python

def EventControl1_OnUnexpectedWindow(Sender, Window, LogParams):
  LogParams.MessageText = "An unexpected window has appeared."
  # Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " + Window.Name + " window has appeared."
  # ....
  LogParams.Priority = pmHighest
  LogParams.FontStyle.Bold = True
  # ...
  # Specifies the color settings
  LogParams.FontColor = clSilver
  LogParams.Color = clFuchsia

VBScript

Sub EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)

  LogParams.MessageText = "An unexpected window has appeared."
  ' Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText = "The " & Window.Name & " window has appeared."
  ' ...
  LogParams.Priority = pmHighest
  LogParams.FontStyle.Bold = True
  ' ...
  ' Specifies the color settings
  LogParams.FontColor = clSilver
  LogParams.Color = clFuchsia
  
End Sub

DelphiScript

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams);
begin
  LogParams.MessageText := 'An unexpected window has appeared.';
  // Specifies the string that will be posted to the Details panel
  LogParams.AdditionalText := 'The ' + Window.Name + ' window has appeared.';
  // ...
  LogParams.Priority := pmHighest;
  LogParams.FontStyle.Bold := True;
  // ...
  // Specifies the color settings
  LogParams.FontColor := clSilver;
  LogParams.Color := clFuchsia;

end;

C++Script, C#Script

function EventControl1_OnUnexpectedWindow(Sender, Window, LogParams)
{
  LogParams["MessageText"] = "An unexpected window has appeared.";
  // Specifies the string that will be posted to the Details panel
  LogParams["AdditionalText"] = "The " + Window["Name"] + "window has appeared.";
  // ...
  LogParams["Priority"] = pmHighest;
  LogParams["FontStyle"]["Bold"] = true;
  // ...
  // Specifies the color settings
  LogParams["FontColor"] = clSilver;
  LogParams["Color"] = clFuchsia;
}

See Also

Test Log
Log Object

Highlight search results