Execute
void Execute(string command, string args, string workingDir, bool wait)Description
Executes an external program or command with optional arguments and working directory.
The function allows running console applications, scripts, or any executable file from within the test environment.
If wait is set to true, the function waits until the executed process finishes before continuing execution.
Otherwise, the function starts the process asynchronously and immediately continues with the next instructions.
Parameter
- command - The path or name of the executable to run.
- args - Command-line arguments to pass to the executable.
- workingDir - The working directory for the process. Can be empty to use the default.
- wait - If true, waits for the process to complete before continuing.
Example
void main()
{
Execute("notepad.exe", "example.txt", "C:\\Temp", true); // Opens Notepad with a file and waits until closed
Execute("ping.exe", "127.0.0.1", "", false); // Runs ping asynchronously
}