The error message "Cannot run because no environments are defined" means that you are missing environment configuration setup in LEAPWORK Studio.
There are three ways to run a flow/test case:
- Run in Preview mode: When you press the "Run" button in the Flow editor, LEAPWORK Studio runs flow in Preview mode. This mode allows to use your displays directly and that’s why you don’t need to specify anything particular and can simply run it.
- Run from the Flows panel: LEAPWORK tries to run a flow or all flows in the Folder when a user presses the Run button on the Flows panel (shown below). Before starting flow execution LEAPWORK checks for the execution environment where all selected flows need to be run, if NO environment is defined earlier then "Cannot run because no environments are defined" message is shown to the user.
- Run from Scheduler: LEAPWORK tries to run all flows defined under Schedule when a user attempts to run Schedule on Ad-hoc basis or if a schedule is auto-triggered by Scheduler. Before starting flow execution LEAPWORK checks for the execution environment defined under the schedule, if NO environment is defined earlier then "Cannot run because no environments are defined" message is shown to the user.
Setting up a default environment will resolve this issue. To be able to do that please follow below steps:
- Go to "Environments" – Click on "New"
- On the "Settings" window fill in the "Title" field and type machine name or IP of the machine where LEAPWORK Agent is installed. If you've installed it on the same machine as the studio, you can type "localhost" in the "Hostname" field.
- Now select the newly created environment before running from Flows panel (shown below)
- Bind your schedule with this environment (as shown below).
If the issue continues, please contact our Priority Support.