Best Practices - Managing and Maintaining Leapwork Remote Agent
Best Practices - Managing and Maintaining Leapwork Remote Agent
In the Leapwork Automation Platform, Agents are the available machines/computers/devices on which the automation flows can be executed. This allows for flows to run uninterrupted and provides the possibility to run the same flow in different configurations.
It is very easy to install, configure and execute flows with Leapwork Remote Agent, however, if you want to scale then one must follow the best practices described below for easy execution and maintenance:
Controlled Access for Agent machines
Agent machines access must be restricted so that only concerned persons have access to manipulate it. Unrestricted access may lead to accidental tampering of configurations and test data, or damage to a particular environment. Here is how one should configure them:
- Only the admin should be able to change configurations: The team should allocate dedicated administrator users that can manipulate Agent configurations. All other users should only use Agents, ensuring that configurations are secured.
- Password protection: Agent must be protected by a password known to team members only to restrict unauthorized access to Agent machines.
- Windows Auto Login: It is better to have a few Automation users (preferably service accounts with known credentials) to log on to Agents during execution, ensuring uninterrupted access to Agent machines.
- Access to the application under test: Having one or a couple of service accounts with access to all applications under test will ensure that applications are testable at the time of flow execution.
Agent Resolution
Agent resolution plays a very vital role when executing virtual environment based (e.g. Citrix, VMware) flows. Here are some best practices to achieve consistency in executions:
Fixing resolution: All users must connect to Agents with the same resolution. The easiest way to achieve this is by fixing resolution in Agent configuration for all Agents. This will ensure that the agent will execute the test in the specified resolution. Click here to read more about "How to keep Agent resolution consistent."
Capturing on the same resolutions: At the time of flow creation, ensure that all images are captured (on the Local Desktop or remote agent) on one resolution only and then executed on the agent with the same resolution.
Flow Execution
Flow execution is one of the most critical processes performed by Agents; thus, it is important to control it properly. Here are some basic guidelines:
- Assign one Agent with one Controller only: Customers with more than one controller might end up allocating one agent to multiple controllers, breaking the test execution if more than one controller requests execution simultaneously.
- Taking over Agents during execution: Users can take over agents even when those agents are executing flows via schedule. Hence, it is very important that everyone in the team is informed about not taking over agent machines when schedule/RunList execution is underway.
- Close Applications after done: Close the application under test when your flow execution is completed. This can be done using close browser, close application, or command-line block, ensuring that the application opened by your last flow does not interfere with the next flow execution.
Flow Data
Test data is a critical part of automation. It's crucial to ensure that the test data required for testing is available at the time of flow execution, following the below practice:
- Files in Agent or share path: Test Files required during flow execution should be present on the Agent machine or in a shared location accessible to the user account under which the Agent service is running.
- Database Connections: If connecting to the database or Excel using ODBC, please use System DSN as shown below.
Configuration & Maintenance
Hardware and software configurations must be optimum, and Agent machines should be monitored and maintained to achieve the best outcomes. Here are a few tips:
- Optimum hardware configurations: Ensure your agent machines have the proper hardware and software configuration needed for flow execution. Following article consists of suggested configurations for Agent machines.
- The application under test configuration: The application under test must be configured properly to give the intended behavior in the Agent machine.
- Refresh agent machine daily: Restart your Agent machines daily to ensure that your Agent's operating system is not consuming memory due to unnecessary applications. This helps in resetting processes that are hung or not responding, and reap benefits such as updates and fresh RAM.
- Remove unnecessary applications and files: Uninstall unnecessary memory-consuming applications from the agent machine to get the best performance.
Automatic Updates
Automatic updates, when enabled, allow you to get the latest security patches and bug fixes automatically. However, machines may be rebooted to apply updates, leading to minutes of downtime during flow execution. Here are a few practices:
- Windows updates: It is recommended not to set Windows Update to download and install updates automatically. A better approach is to download updates but apply them explicitly, e.g., at midnight or when your machine is scheduled to reboot. Various methods, such as PowerShell scripts or Software Update Services (SUS), can automate this process.
- Turn off Automatic browser updates: Since web test cases are executed using Selenium, it's crucial to have browser version consistency with corresponding compatible driver versions. Turning off automatic updates helps avoid version mismatches, allowing for a planned regular update policy.
For any specific queries, please contact our Priority Support.