Basic Windows Operations

The automation tools modules for basic window operations can steer windows, dialogs, context menus, takes screenshots, or perform clipboard actions.

TBox Take Screenshot

This module takes a screenshot of the currently active screen. You can specify the following values when you use this module:

Value

Description

Environment

Defines whether you want to take a screenshot of your desktop, mobile device, or browser.

If you leave the value empty, Tosca Cloud takes a screenshot of the desktop.

Storage Location Type

Optionally, specify whether you want to save your screenshot to a local Directory.

Directory

Optionally, specify a local path to save the screenshot to.

Filename

File name of the screenshot. This name doesn't include the file extension.

Select Screen

Optionally, specify which screen or application you want to capture. You can choose from the following options:

  • Active Monitor: Capture the screen which currently has an active application.

  • Active Window: Capture the currently active application window.

  • Everything: Capture all currently connected screens.

  • An integer <n>: Capture a specific screen, identified by its index. For example, to capture the second screen connected to your machine, enter 2.

If you don't specify a value, Tosca Cloud takes a screenshot of all connected screens.

TBox Clipboard

This module allows you to copy text to the Microsoft Windows clipboard. You can also use it to verify the text that's in your clipboard, save that text to a buffer, or wait until text is in the clipboard. You can specify the following value when you use this module:

Value

Description

Value

Value that you want to copy to the clipboard, verify, buffer, or wait for.

Depending on the desired action, use action mode Input, Verify, Buffer, or WaitOn respectively.

TBox Dialog

This module steers dialog windows. Note that you can steer Microsoft Windows dialogs without scanning them. To steer customized dialogs, you need to scan them first. You can specify the following values when you use this module:

Value

Description

Caption

Caption of the dialog window that you want to steer. This caption identifies the dialog window.

Label

Optionally, you can enter the text of the dialog window’s first paragraph for further identification. It's not necessary to enter the entire text.

Button

Specify which button Tosca Cloud should click to confirm the dialog. Enter the text of the button.

TBox Context Menu

This module controls context menus of applications based on .NET and WinForms and the Microsoft UI Automation framework.

Note that the context menu that you want to steer has to be open so Tosca Cloud can detect it.

You can specify the following values when you use this module:

Value

Description

Menu

Path to the menu item. Specify the context menu path with ->, for instance Insert->Image.

Menu-><MenuItem>

Alternatively, you can use this value to steer a context menu with control hierarchy instead.

TBox Send Keys

This module uses the WinForms function SendKeys and sends keyboard commands to a window.

To use dynamic expressions in your keyboard commands, select the Data Type String.

You can specify the following values when you use this module:

Value

Description

Caption

Optionally, enter the caption assigned to the window you want to steer. Tosca Cloud brings the window to the foreground.

You can add either a leading or trailing wildcard, for instance a wildcard at the beginning or at the end of a string.

Keys

Keyboard command that you want to send to the window.

By default, the Data Type is RawString. Tosca Cloud sends RawString data exactly as entered to the system under test. No need to escape special characters.

Tosca Cloud uses the WinForms function SendKeys. For a list of available SendKeys commands and their syntax, see the Microsoft SendKeys documentation (opens in new tab).

If you activate CAPS LOCK on your machine, Tosca Cloud sends the keys inverted. For example, if you want to send Abc and have CAPS LOCK on, Tosca Cloud sends aBC.

TBox Window Operation

This module sends specific commands to a window. You can specify the following values when you use this module:

Value

Description

Caption

Caption of the window you want to steer. The caption identifies the window.

Child Window Caption

Caption of the child window you want to steer. The caption identifies the child window.

Operation

Command for steering the control. You can choose from the operations described in the table below.

Operation->Height

Required height of the window in pixel. Mandatory if you have selected the operation Resize.

Operation->Width

Required width of the window in pixel. Mandatory if you have selected the operation Resize.

Window Index

Window that Tosca Cloud should apply the specified Operation to. Optional, but useful if the Caption that you have specified applies to more than one window. For instance if you use a wildcard.

Tosca Cloud supports the following operations:

Operation

Description

Bring to Front

Instructs Tosca Cloud to bring the window to the front.

Bringing a window to the front may take longer, depending on the complexity of the window UI and your machine's performance. We recommend to add a test step after this operation so that Tosca Cloud waits until a control on the window is visible before executing the next test step.

Close

Closes the window.

Maximize

Maximizes the window.

Minimize

Minimizes the window.

Move to Center

Moves the window to the center of the screen.

Normal

Restores the window to its original size

Resize

Resizes the window to the height and width that you have specified in the Height and Width fields .

Try Bring To Front

Brings the window to the front but if unsuccessful, moves on to your next test step. Your automation continues and Tosca Cloud shows the Try Bring To Front test step as failed.

Verify Window Exists

Verifies whether the specified window is open.

Close

Verifies whether the specified window is closed.

Wait On Close

This operation requires the action mode WaitOn.

If you combine the operation with the value Window Index, Tosca Cloud waits until the number of open Windows with the specified caption is lower than the value of Window Index.

Wait On Open

This operation requires the action mode WaitOn.

If you combine the operation with the value Window Index, Tosca Cloud waits until the number of open Windows with the specified caption is equal to or greater than the value of Window Index.

TBox Scroll Window Operation

This module defines scrolling behavior. You can specify the following values when you use this module:

Value

Description

Caption

Caption of the application window that Tosca Cloud should scroll. This caption identifies the application window.

Window Index

Specifies the window that Tosca Cloud should scroll based on the opening order.

This value is optional, but useful if the Caption that you have specified applies to more than one window. For instance if you use a wildcard.

Vertical

Specifies in pixels (px) or lines (lines) how far Tosca Cloud scrolls along the vertical axis. If you specify a number without a unit of measurement, the page scrolls for the number of mouse wheel notches.

Horizontal

Specifies in pixels (px) or lines (lines) how far Tosca Cloud scrolls along the horizontal axis. If you specify a number without a unit of measurement, the page scrolls for the number of mouse wheel notches.

Note that this value only works if horizontal scrolling is supported by the application window.

MousePolicy

Specifies where Tosca Cloud should position the mouse pointer during scrolling.

Enter one of the following values: Center (default), None.

DirectionPolicy

Specifies whether Tosca Cloud should scroll along the vertical or horizontal axis first.

Enter one of the following values: NoDirectionPolicy (default), HorizontalFirst, VerticalFirst.

Delay

Specifies the time in milliseconds (ms) that Tosca Cloud should wait between scrolling along the vertical and horizontal axis.

TBox Save As

This module steers the dialog window Save As. To steer it, the Save As dialog has to be open. You can specify the following values when you use this module:

Value

Description

Caption

Caption of the Save As dialog that you want to steer. Tosca Cloud identifies the dialog from the caption in the upper section of the screen (WindowText). You can enter any string. This value is mandatory.

FileNameLabel

Label of the input field where you enter the path in the Save As dialog.

You only need to specify the label if the input field is NOT File name. If the label is File name, Tosca Cloud steers it automatically. You can enter any string.

FilePath

Path where Tosca Cloud saves the file. This value is mandatory.

Button

Specify which button Tosca Cloud should click.

Tosca Cloud steers Save or Cancel automatically. You only need to specify the button if the button is NOT Save or Cancel. This value is optional.

ConfirmationPopupCaption

Path where Tosca Cloud saves the file. This value is mandatory.

ConfirmationPopupButton

Path where Tosca Cloud saves the file. This value is mandatory.