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, open a file picker dialog or to call Python and VBS scripts with sendkeys. 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.

See also: Instead of starting a script from UI.Vision RPA with XRun, you can also start UI.Vision RPA from a script via the command line API.

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)

In general we recommend to use XRun or XRunAndWait to start another scripting languages like Batch files, Bash, PowerShell, Python or VBS, and then use these scripting languages to start other application programs like Adobe Photoshop, Skype, Word or Zoom (related forum post). The reason is that all these programs behave differently at startup, and the full-grown scripting languages are better suited to manage this. XRun itself is optimized and tested from us "only" to start other scripts. We can not test with all the 1000s of applications available on the market. So in other words: XRun/XRunAndWait are designed to start scripts in other scripting languages.

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 Open-Source RPA software Github repository.

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
← Meet the Ui.Vision team and users on our RPA software forum.