Application package guide
Open programs and files, then test whether an application process is running.
Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.
Prerequisites
Use a Windows Device with the application installed and a compatible Mercury runtime. To open a visible application or wait for its window, a user must be signed in on the Device. The conditions check process names and do not need a visible window.
Create C:\AutomationSamples\invoice.txt that contains Invoice sample. The examples use this Notepad document. Close it after your checks: this package does not close an application. Arguments and working folders are local Device values, not room credentials.
Numbers are whole numbers. Fields not marked required are optional. A missing program or file fails the step.
Condition inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
application | Application path | Stringdefault emptyrequired. | Program name, such as notepad or notepad.exe. A full path also works, but only the name is checked, not the folder. |
wait | Wait for this condition (seconds) | Numberdefault 0 | Seconds to keep checking (every 250 ms). 0 or less checks once. |
Actions
Open program/file (applicationRunApp)
Start a program or open a file through Windows. Use the title wait when the next step needs a visible application.
Inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
file | Location of the program/ | Stringdefault emptyrequired. | Program or file to open, such as notepad.exe or samples/. A relative path uses the automation folder only when the file exists there. |
start | Start in path | Stringdefault empty | Working folder. Empty: the automation folder, if it exists. |
parameters | Parameters | Stringdefault empty | Arguments for the program. Put quotes around file names with spaces. Empty: no arguments. |
window | Window title to wait for | Stringdefault empty | Part of the window title to wait for. Empty: does not wait for a window, so the program may not be ready yet. |
timeout | Timeout | Numberdefault 30 | Seconds to wait for window, 1 to 99. Not used when the title is empty. |
Outputs
No outputs.
Example
Set filePath=notepad.exe, startInPath=C:\AutomationSamples, parameters=invoice.txt, windowTitle=invoice.txt, timeout=20.
Expected result
Notepad opens the sample file, and a window title with invoice.txt appears within 20 seconds. If Windows refuses to open it or the title does not appear, the step fails.
Conditions
Both conditions use the same inputs. Each is true if it is met within the wait time, else false. An error fails the condition.
Application is not running (applicationDoesNotRunning)
Test whether no process with this name is running.
Inputs
Uses the condition inputs.
Outputs
No outputs.
Example
Close the Notepad sample. Set applicationPath=notepad.exe, waitTimeout=5.
Expected result
True when no Notepad process remains. False if one still runs after 5 seconds.
Application is running (applicationRunningExists)
Test whether at least one process with this name is running. A running process does not prove that its window is ready.
Inputs
Uses the condition inputs.
Outputs
No outputs.
Example
Open the Notepad sample. Set applicationPath=notepad.exe, waitTimeout=5.
Expected result
True when a Notepad process is found. False when none appears within 5 seconds.