How can we choose the order of the cases in the Scheduling?
How can we choose the order of the cases in the Scheduling?
Introduction
If you are using Leapwork for robotic process automation, you can think of run lists to control the order in which your robots run.
There are two ways to decide the order of the flows:
Ordering Flows In Steps
The scheduler executes automated test cases in the order they have been arranged in the run list, from top-down. However, you can rearrange the flow order in a run list by dragging and dropping the flows as required. Click on the below highlighted icon against desired test case to be moved:
Ordering Flows Using Teardown Approach
Using a “setup-run-teardown” pattern and using conditions to control if certain steps are run or not.
A Run List always consists of one or more steps. Each step in a Run List can have one or more flows to be executed. Users can add multiple steps to define and control the execution of the flows. The first step is always executed, and the rest of the steps can be made conditional, i.e. their execution can be controlled based on the outcome of the previous step.
There are 4 available conditions to choose in the 'Step':
| Always run | This condition should be selected if the user needs to run all the flows irrespective of whether the flows in any previous step have failed. |
| Only run if previous step has succeeded | This condition should be selected in a step when the user wants to run the tests in that step only if all the tests in the immediately preceding step have succeeded. |
| Only run if all previous steps have succeeded | This condition should be selected in a step when the user wants to run the tests in that step only if all the tests in all previous step(s) have succeeded. |
| Only run if any previous steps have failed | This condition should be selected in a step when the user wants to run the tests in that step only if any of the tests in any previous step(s) have failed. |
After designing automation flows, users can schedule these flows to run automatically in different operating systems and with different browsers using the Scheduler configuration.
Once a schedule is created, it is saved on the Controller. This means the user defines the schedule in Leapwork Studio, whilst the Controller keeps track of the schedule and handles the execution on the environments.
Schedules are associated with run lists and can be accessed from the top menu of ‘Run Lists’.
Under 'Agents' ( see more in Agents), select one or more agents on which the defined flows in each step should execute.
| Agent Distribution: |
| Select 'All flows on each agents' to run all the selected automation flows on all Agents when all of them are available for execution. |
| Select 'Divide flows on agents' to distribute the selected automation flows equally to all Agents when all of them are available for execution |
| Select 'All flows on first available agent' to run your flows on first available Agent only. Please note that all flows will be executed on the first available Agent only, even though other Agents are free |
| Flow Sequence: |
| Select 'Run in order' to run all the selected automation flows in a defined flow sequence. |
| Select 'Run in random order' to execute the selected flows in any random order. |
To know more about Run Lists and Schedules, see tutorial schedules-run-lists.
For any clarification, please contact our Priority Support.