XRun | Path to App | command line parameters (if any)

The XRun and XRunAndWait commands are used to start external scripts from within a UI.Vision macro. The applications for this are endless. For example, you can start apps and then UI-automate them with XClick and XType. Or you use XRun to call a batch/bash command to extend the features of UI.Vision, for example to delete downloaded files. You can launch, for example, a Python or a PowerShell script to save data or connect to a database. The screencast below shows a short XRunAndWait tutorial.

XRunAndWait Tutorial. The PowerShell script used in the video is available on Github.

What is the difference between XRun and XRunAndWait?

XRun starts the app, and this is all. So the XRun command is very fast. By contrast, XRunAndWait starts the program and waits for the program or script to complete. Programs that close can set an so-called "Exit Code". If the scripts sets such a code, XRunAndWait captures this return code and stores it in the ${!xrun_exitcode} variable. So the variable is only set after an XRunAndWait command. In the video tutorial above we use XRunAndWait. The demo macro DemoXRun shows the XRun behavior.

XRun and XRunAndWait Example

We use XRun to start a calculator on macOS. You can start anything with XRun, for example PowerShell or Python scripts.

Command Target Pattern/Text
XRun /Applications/Calculator.app/Contents/MacOS/Calculator (command line parameters for app, if any)

Works in

UI.Vision RPA for Chrome and UI.Vision RPA for Firefox with the XModule installed.

Related Demo Macros


The ready-to-import-and-run source code of all demo macros can be found in the Github repository testmacros folder.

See also

XClick, XMove, XModules User Manual

Important: Do not confuse XRun with the Selenium IDE RUN command.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

<em>UI.Vision RPA</em> Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the UI Vision RPA software newsletter . We'll send you updates on new releases that we're working on.