SystemHelpers

Description

Various methods to interact with the operating system. Implements the ISystemHelpers interface.

You can access the SystemHelpers through the generated App class from your test case:

App.SystemHelpers.CreateFolderPath(@"C:\Temp");

Or from a screen through the IAppBasics Interface:

AppBasics.SystemHelpers.DeleteFile(@"C:\Temp\Dummy.txt");

SystemHelpers Class

Namespace: Progile.TRIO.EnvironmentModel Assembly: Progile.TRIO.EnvironmentModel.Windows (in Progile.TRIO.EnvironmentModel.Windows.dll)

Inheritance Hierarchy:

Object Progile.TRIO.EnvironmentModel.SystemHelpers

Constructors

Syntax:

public SystemHelpers(
	ITester t
)

Parameter

Description

t

Type: ITester

The tester interface.

Methods

Name

Description

Checks if a file or folder exists on the SUT filesystem. To check if a folder exist pass in the folder with the path without the last "\" at the end.

Closes all instances of the webbrowser. Warning for Close all tabs will be confirmed. Throws an exception if after 5 minutes not all windows could be closed.

Copies the file(s) from the source path to the destination folder path using following cmd: xcopy /q /h /y "{source}" "{destination}". The name of the file will remain the same. Note: For copying folders including its subdirectories use CopyFolder instead.

Copies the folder (with all files and subfolders) from the source path to the destination folder path using following cmd: xcopy /q /i /e /h /y "{source}" "{destination}" If destination folder does not exist yet, it will be created.

Creates new folders for the specified path using mkdir command. If path already exists, command will return an error, but no further action is done (the outcome of the CreateFolderPath method is unaffected).

Deletes a file or folder on the SUT filesystem. To delete a folder include the "\" at the end to indicate it's a folder.

This method checks that the desktop of the environment is completely loaded and checks the CPU load of the SUT from the cmd window to ensure the system is responsive (CPU load below 40%). If an installer testcase is used, this should be called from installer Precondition step, otherwise from test case Precondition step.

Determines the current CPU load percentage on the SUT by running the wmic cpu get loadpercentage.

Gets the computer name of the SUT with the hostname command.

Returns a list of all file- and folder names contained in the specified folderPath that match the providedfileNameFilter. The result list is sorted by date/time, oldest first.

Gets the build version of the operating system on the SUT.

Kills a program or process from the run menu in windows (using Win-R key-shortcut).

Logs the name and version of the environment model contained in this assembly. Should be called in setup test step of every test case using the environment model.

Logs in the most recent user to windows from the welcome or lock screen if required.

If login failed a TestStepAbortedException is thrown.

Checks if a cmd window is already open on the screen, if not opens a new cmd window, if yes prepares it for new commands.

This is a Windows specific method and cannot be used on other environments! Checks if a cmd window is already open in administrator mode on the screen, if not closes any other cmd window and opens a new cmd window in administrator mode, if yes prepares it for new commands.

Opens a folder or file, or starts a program at path from the file explorer.

Runs the webpage.bat from Installer directory that will open the target webpage for the SUT.

Starts a program or process from the run menu in windows (using Win-R key-shortcut).

Mounts the remote directory that is provided by the execution host. If assigned drive is already in use, it is disconnected first. Uses default drive letter R.

Mounts the remote directory that is provided by the execution host to the specified drive. If assigned drive is already in use, it is disconnected.

Start to monitor heartbeat based on Windows clock.

Stop the heartbeat monitoring.

Extracts an archive to the destination folder.

Properties

Name

Description

The path to the artifacts directory that is mapped on the SUT. The content of the artifacts directory will be provided for download in artifacts folder for the report in the TestResults.io portal. By default: "R:\"

The path to the directory where the installer files are mapped on the SUT. By default: "R:\RequestedContent\SoftwareExecutable\"

The Type of the SUT OS, i.e. Windows.

The path to the directory where the supporting files are mapped on the SUT. Default: "R:\SupportingFiles\"

Gives access to the system interactions implementation that provides basic interactions such as keyboard shortcuts for the target operating system.

The path to a temporary folder that is unique to the currently running tc. Default: "C:\Temp\{reportId}\"

The rectangle of the SUT screen that can be used by a windowed application. In particular for Windows it subtracts the taskbar height from the fullscreen.

The Windows Version of the SUT. It can be set from externally, but typically is determined during the EnvironmentReady method based on the windows start button.

Last updated