Extended Commands

Command

Description

Calculator

The `Calculator` command is designed to perform mathematical calculations based on expressions you provide, such as `Calculator “{var}+1”`. This functionality is especially useful within loops, for example, to create a countdown mechanism. You can use it in a `While` loop by setting a condition like `While {repeatNumber}>”0”`, then decrementing the value with `Calculator “{repeatNumber}-1”`, and updating the variable with `Set “repeatNumber” {CalculatorResult}`. The result of each calculation performed by the `Calculator` command is stored in the `{CalculatorResult}` parameter, making it easy to access and use for further actions or conditions within your script.

Capture

The `Capture` command comes in several variants, all designed to take screenshots, with a particular focus on capturing specific areas of the desktop in relation to a target image. For example, if you have a graph titled “Graph” on your screen, you can use this command to take a picture of just the area right below the title. This is really useful for capturing parts of your screen that change or move around, without having to guess where they are.

Capture (without parameters)

The `CaptureWithoutParameters` command is designed to easily take a screenshot of the entire screen. This is useful for capturing everything visible on your monitor at once.

Capture (with parameters)

You can also use Capture to take a more focused screenshot of a specific area within an image that the software recognizes on your screen. This is done by specifying an image to look for and then defining an area relative to that image with coordinates and size (x, y, width, height). For example, Capture <image> x, y, w, h would capture a portion of the screen based on the identified image’s location.

 

Additionally, you have the option to capture specific parts of the screen by using the `Capture` command with parameters. After initially capturing the whole screen, you can focus on a smaller area for a detailed capture. For instance, you first capture the entire screen, save this screenshot with the command `Set “sshot” {CapturedImage}`, and then zoom in on a particular area of this screenshot by specifying coordinates and dimensions (for example, `Capture {sshot} 50 50 100 100`). This process allows you to first get a general view and then capture a specific, detailed part of that view.

ClearLog

The `ClearLog` command is used to delete the contents of a file. By default, it is set to work with .csv files, but it can actually be applied to any file type.

 

IMPORTANT: use this command cautiously because it replaces the existing file with a new, empty file that has the same name. This means any data previously in the file will be permanently lost.

DeleteCapture

The DeleteCapture command is designed to delete the most recent screenshot taken with the Capture command. This command ensures that once a screenshot is no longer needed, it is removed not only from the script’s memory but also from the computer’s storage.

DragDrop

The DragDrop command is utilized to specify the target location for a drag and drop operation. This command can work with either an image or a specific location defined by coordinates (e.g., DragStart 300, 300). To effectively execute a DragDrop operation, one must first specify the starting point using the DragStart command, which sets the initial position from which the object or element will be moved. Following this, the DragDrop command completes the action by moving the element to the designated target location.

DragStart

The `DragStart` command determines the start point of a drag and drop action. It can be based on an image or a specified location, such as using coordinates (e.g., `DragStop 300 300`).

GetClip

The `GetClip` command retrieves the current contents of the clipboard and stores it in a parameter named “Clip”. This allows you to access and use whatever text or data was last copied to the clipboard in your script.

Log

The `Log` command is used to record test results into a CSV file. The syntax for this command is `Log <path to output CSV file> <delimiter in the CSV (“,” or “;”, etc)> <output data, such as a string or parameter value>`. This command allows you to specify the location of the CSV file where the log should be saved, the delimiter used in the file (like a comma or semicolon), and the data you want to log. It’s a useful tool for tracking and reviewing the outcomes of your tests in a structured format.

Set

The `Set` command is used to create a new local parameter and assign a value to it. This value can be a constant or derived from another parameter, such as the output of a previous command.

SetRandom

The `SetRandom` command allows you to assign a random value to a specified parameter from an array of provided inputs. For instance, when you use `SetRandom “test” “2” “10” “15”`, the command selects a random value from the options “2”, “10”, and “15”, and assigns it to the parameter named “test”. This means the “test” parameter could end up with any of the provided values, making each script execution potentially different based on this random choice.

NOTE: While `SetRandom` can be useful for certain scenarios requiring variability, it is recommended to use this function with caution for automated testing purposes. This is because the introduction of randomness can lead to non-deterministic outcomes, making it challenging to predict and replicate test results consistently.

Stop

The `Stop` command is used to immediately halt the execution of a script. This command is useful for ending a script either after completing its intended tasks or when a specific condition is met that requires stopping the script prematurely.

Store

The `Store` command plays a crucial role in enabling the sharing of global parameters across different scripts, a feature particularly valuable when direct value return to a calling script is not feasible. By using `Store <parametername> <value>`, you can easily save a value under a specified parameter name. This stored value can then be retrieved in any part of the script or even in parent scripts invoked by higher-level scripts, using `Store <parameter>`. This mechanism is essential for maintaining data consistency and flow between scripts, especially when coupled with commands like `Calculator` for performing calculations. The ability to store and extract values seamlessly across scripts enhances script interoperability and data manipulation, ensuring that essential data is accessible where and when it’s needed.

Parameters

Set

The `Set` command lets you create a parameter and give it a value. For example, when you do `Set {location} “500 500”`, you’re saving the coordinates “500 500” as the value for `location`. Later on, you can use this parameter in other commands, like `Click {location}`, to perform an action at those coordinates. It’s a way of saving a piece of information so you can use it again later in your script, making your commands more dynamic and flexible.

Expressions

You can create expressions, e.g. {Param}=“value” or {Param}<“2”, and use these in “If” and “IfNot” statements.

Expressions let you set up conditions using parameters, like comparing a parameter to a specific value or checking if it’s less than a certain number. For example, you can write expressions like `{Param}=”value”` to check if `Param` equals “value”, or `{Param}<“2″` to see if `Param` is less than “2”. You can use these expressions in `If` and `IfNot` statements to control what happens in your script based on whether the conditions are true or not. This way, you can make decisions in your script, like taking different actions depending on what values your parameters have.