Maximize Action

Applies to TestComplete 15.0, last modified on October 22, 2021

Description

This action brings the window to full-screen (maximizes it) if it is a top-level window or an MDI-child window. It has no effect on popup windows and controls, except that an error message is inserted into the test log.

Note that once a window is maximized, its left and top coordinates are negative.

Declaration

TestObj.Maximize()

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Result None

Applies To

The method is applied to the following objects:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Result Value

None.

Example

The following example demonstrates how to use the Maximize method in scripts:

JavaScript, JScript

var w = Sys.Process("notepad").Window("Notepad", "*", 1);
w.Activate();
w.Minimize();
w.Restore();
w.Position(10, 10, 450, 250);
w.Maximize();
w.Restore();
w.SetFocus();

Python

w = Sys.Process("notepad").Window("Notepad", "*", 1)
w.Activate()
w.Minimize()
w.Restore()
w.Position(10, 10, 450, 250)
w.Maximize()
w.Restore()
w.SetFocus()

VBScript

Set w = Sys.Process("notepad").Window("Notepad", "*", 1)
w.Minimize
w.Restore
w.Activate
w.Minimize
w.Restore
Call w.Position(10, 10, 450, 250)
w.Maximize
w.Restore
w.SetFocus

DelphiScript

var w;
begin
  w := Sys.Process('notepad').Window('Notepad', '*', 1);
  w.Activate;
  w.Minimize;
  w.Restore;
  w.Position(10, 10, 450, 250);
  w.Maximize;
  w.Restore;
  w.SetFocus;

end;

C++Script, C#Script

var w = Sys["Process"]("notepad")["Window"]("Notepad","*", 1);
w["Activate"]();
w["Minimize"]();
w["Restore"]();
w["Position"](10, 10, 450, 250);
w["Maximize"]();
w["Restore"]();
w["SetFocus"]();

See Also

Restore Action
Minimize Action
Position Action

Highlight search results