Best Practices - Working with Schedules

Best Practices - Working with Schedules

A schedule enables Leapwork users to define when flows should run, and on which agents - whether at pre-selected times or after specified time intervals. Schedules can be triggered either on-demand (such as through REST API calls to Leapwork) or at a single or recurring time interval.

Why should I use schedules?

Users can leverage the power of schedules to achieve many scenarios that otherwise look strenuous. One of the major challenges most organizations face is running automation in a continuous manner and ensuring the optimum usage of agents by doing parallel testing. When we follow best practices, Leapwork schedules can help us to overcome these challenges.

When should I use Schedules?

Execute Unattended Automation
If we wish to execute our test cases automatically without manual interventions, we will need to schedule our tests. With Leapwork, we can configure the time recurrence of the schedule, which will enable us to test even when we are away from the office.

Achieve Continuous Testing
Continuous testing is the process of executing automated tests as part of the software delivery pipeline in order to get early feedback for each release candidate. It advances and stretches out test automation to address the complexity and pace of application development and delivery. We can use the Leapwork schedule functionality to achieve continuous testing with minimal effort.

Achieve Parallel Testing
Parallel Testing implies testing various applications or sub-components of one application simultaneously to decrease testing time. Parallel tests consist of two or more parts (projects or project suites) that check the different flows or functional attributes of an application. These flows are executed on individual computers or devices simultaneously. The ability to test more than one application part "in parallel" enables us to reduce test time and become more efficient. The use of schedules in Leapwork is strongly recommended for parallel testing.

Implement CI/CD Pipeline
A CI/CD pipeline is the foundation of a cutting-edge DevOps setup. It overcomes any issues among development and operations teams by automating the building, testing, and deployment of applications. Automated pipelines remove manual errors, provide standardized development feedback loops, and enable fast product iterations. Leapwork's Public REST API enables us to use schedules to support the implementation of a CI/CD pipeline.

How should I use schedules?

Continuous Testing using schedules

Scheduling is one of the major features of Leapwork. If used correctly, it can ensure less time to market and high product quality with a reduction in development costs.

There are two ways to run schedules and perform continuous testing:

Run parallel tests to reduce time to production

Running tests in parallel can give benefits like:

Leapwork enables users to run multiple flows at the same time in different machines by executing them in parallel. Users can also run tests pairwise, where each flow will run on all selected environments to test all possible discrete combinations. The following article explains how to achieve parallel and pairwise tests in Leapwork.

Set an automatic notification after test execution is completed

Automatic notifications help the team to be on the same page and take prompt actions if a test fails. Leapwork provides an 'Actions' option, where users can add actions that are triggered on specified conditions. Each schedule can contain multiple actions. Using these options ensures timely notifications about failures so the team can fix bugs quickly to save time and costs.

For more detail, please visit the scheduler's action page.

Stop testing if test failure reaches a certain threshold

If our test environment is not working or there is a bug in the application that does not allow us to test properly, then it makes sense to stop/skip the execution of our automated test to save resources and ensure the team can take corrective actions quickly.

Let's try to understand this scenario with an example: Assume our login feature is not working and we are using that feature in 80% of our test cases. If we are executing our test, we will usually come to know this after a full test automation run is completed. This might take hours if we have a large number of tests, which means we have wasted resources and time.

Instead, Leapwork enables us to stop the execution run if 20% of tests fail or if the user wants to disable the scheduler on the failure of 'n' number of test flows. With this feature, we can get quick notifications of failure and fix the underlying issue instead of wasting time and resources.

Here is how we can configure error handling in Leapwork:

The Leapwork scheduler provides control over automation flows and helps to optimize time and resources. Among many things, it includes the following:

For any further clarification, please contact our Priority Support.