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 test:
- Run in Preview mode: When you press the “Run” button in the Test case editor, Leapwork Studio runs your case in Preview mode. This mode allows us to use your displays directly and that’s why you don’t need to specify anything particular and can simply run it.
- Run from project panel: Leapwork tries to run all tests in the project when a user presses the Run button on the Project panel (shown below). Before starting test execution Leapwork checks for test execution environment where all tests from the selected Project 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 tests 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 test execution Leapwork checks for test execution environment defined under the schedule, if NO environment is defined earlier then “Cannot run because no environments are defined” message is shown to 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 Edit Environment window fill in the “Title” field and type “localhost” in the “Hostname” field .
- Now select the newly created environment before running tests from Project panel (shown below)
- Bind your schedule with this environment (as shown below).
If the issue continues, please contact our Priority Support.