Locked Property

Applies to TestComplete 15.46, last modified on January 09, 2023

Description

Set this property to True to cancel the posting of a message to the Test Log. For instance, if an unexpected window appears during the script execution, TestComplete posts an image of this window and an error message to the test log (see the example below).

Declaration

LogParamsObj.Locked

Read-Write Property Boolean
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

If the property is True, the posting of a message to the test log will be canceled.

Remarks

If you use this property to cancel folder creation, you do not need to pop the folder.

Example

The following code can be used if you want to post an image of the whole screen to the test log.

JavaScript, JScript

function OnUnexpectedWindow(Sender, Window, LogParams)
{
  // Posts an image of the whole screen
  Log.Picture(Sys.Desktop.Picture(), "Image of the whole screen");
  // You can abort further posting,
  // since you have already posted the needed image
  LogParams.Locked = true;
}

Python

def OnUnexpectedWindow(Sender, Window, LogParams):
  # Posts an image of the whole screen 
  Log.Picture(Sys.Desktop.Picture(), "Image of the whole screen")
  # You can abort further posting, 
  # since you have already posted the needed image 
  LogParams.Locked = True

VBScript

Sub OnUnexpectedWindow(Sender, Window, LogParams)
  ' Posts an image of the whole screen
  Log.Picture Sys.Desktop.Picture(), "Image of the whole screen"
  ' You can abort further posting,
  ' since you’ve already posted the needed image
  LogParams.Locked = True
End Sub

DelphiScript

procedure OnUnexpectedWindow(Sender, Window, LogParams);
begin
  // Posts an image of the whole screen
  Log.Picture(Sys.Desktop.Picture(), 'Image of the whole screen');
  // You can abort further posting,
  // since you’ve already posted the needed image
  LogParams.Locked := True;
end;

C++Script, C#Script

function OnUnexpectedWindow(Sender, Window, LogParams)
{
  // Posts an image of the whole screen
  Log["Picture"](Sys["Desktop"]["Picture"](), "Image of the whole screen");
  // You can abort further posting,
  // since you’ve already posted the needed image
  LogParams["Locked"] = true;
}

See Also

Test Log
Log Object

Highlight search results