Execute Method

Applies to TestComplete 15.31, last modified on March 17, 2022

Description

Use this method to command TestComplete to execute the low-level procedure to which LLPObj provides scripting access.

If the Window parameter is omitted or if it is Nothing (VBScript), None (Python), nil (DelphiScript) or null (JavaScript, JScript, C++Script, C#Script), TestComplete treats coordinates stored in the low-level procedure as screen coordinates (that is, it runs the procedure relative to the screen). If the Window parameter specifies a window, TestComplete treats the coordinates as window-based coordinates (that is, it runs the procedure relative to the specified window).

Declaration

LowLevelProcedureObj.Execute(Window)

LowLevelProcedureObj An expression, variable or parameter that specifies a reference to a LowLevelProcedure object
Window [in]    Optional    A window object    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Window

Specifies the window object that corresponds to the window where the procedure will simulate mouse and keyboard events over.

Result Value

None.

Example

The following example demonstrates how you can call a low level procedure simulating user actions over the Paint window.

JavaScript, JScript

function Main()
{
  var mspaint = Sys.Process("mspaint");
  var Window = mspaint.Window("MSPaintApp", "*");
  // Obtains the window where low-level actions will be simulated
  var Frame = Window.Window("AfxFrameOrView42u", "", 1).Window("Afx*");
  // Activates the MSPaint window
  Window.Activate();
  // Executes the "LLProcedure1" low-level procedure
  LLCollection1.LLProcedure1.Execute(Frame);

}

Python

def Main():
  mspaint = Sys.Process("mspaint")
  Window = mspaint.Window("MSPaintApp", "*")
  # Obtains the window where low-level actions will be simulated
  Frame = Window.Window("AfxFrameOrView42u", "", 1).Window("Afx*") 
  # Activates the MSPaint window
  Window.Activate()
  # Executes the "LLProcedure1" low-level procedure
  LLCollection1.LLProcedure1.Execute(Frame)

VBScript

Sub Main

  Set mspaint = Sys.Process("mspaint")
  Set Window = mspaint.Window("MSPaintApp", "*")
  ' Obtains the window where low-level actions will be simulated
  Set Frame = Window.Window("AfxFrameOrView42u", "", 1).Window("Afx*")
  ' Activates the MSPaint window
  Window.Activate
  ' Executes the "LLProcedure1" low-level procedure
  LLCollection1.LLProcedure1.Execute(Frame)

End Sub

DelphiScript

procedure Main();
var mspaint, Window, Frame;
begin
  mspaint := Sys.Process('mspaint');
  Window := mspaint.Window('MSPaintApp', '*');
  // Obtains the window where low-level actions will be simulated
  Frame := Window.Window('AfxFrameOrView42u', '', 1).Window('Afx*');
  // Activates the MSPaint window
  Window.Activate;
  // Executes the "LLProcedure1" low-level procedure
  LLCollection1.LLProcedure1.Execute(Frame);

end;

C++Script, C#Script

function Main()
{
  var mspaint = Sys["Process"]("mspaint");
  var Window = mspaint["Window"]("MSPaintApp", "*");
  // Obtains the window where low-level actions will be simulated
  var Frame = Window["Window"]("AfxFrameOrView42u", "", 1)["Window"]("Afx*");
  // Activates the MSPaint window
  Window["Activate"]();
  // Executes the "LLProcedure1" low-level procedure
  LLCollection1["LLProcedure1"]["Execute"](Frame);

}

See Also

Testing Applications in Low-Level Mode
Running Low-Level Procedures
LLPlayer Object
Window- and Screen-Relative Low-Level Procedures

Highlight search results