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 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 admin should be able to change configurations: Team should allocate dedicated administrator users that can manipulate Agent configurations and all other users should only use Agents, this will ensure 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 few Automation users (preferably service accounts with known credentials) to logon to Agents during execution, it helps in ensuring uninterrupted access to Agent machines.
- Access to the application under test: Again having one/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 plays a very vital role when we try to execute virtual environment based (e.g. Citrix, VMware) flows, here are some best practice we need to follow to achieve consistency in executions:
- Fixing resolution: All users must connect to Agents with the same resolution, the easiest way to achieve this is to fix resolution in Agent configuration for all Agents as shown below, this will ensure that 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, the user has to ensure that all images are captured (on Local Desktop or remote agent) on one resolution only and then executed on the agent with the same resolution.
Flow execution is one of the most critical processes performed by Agents and so it is important to control it properly, here are some basic guidelines to be followed
- Assign one Agent with one Controller only: Customers with more than one controller might end up with allocation one agent to multiple controllers, this will break the test execution if more that one controller requests for execution at the same time.
- 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 bu using a close browser, close application, or command-line block, this will ensure that application open by your last flow does not interfere execution with the next flow execution.
Test data is a critical part of automation and it's crucial to ensure that the test data required for testing is available at the time of flow execution, please ensure below practice while executing flows with data on Agents
- Files in Agent or share path: Test Files required during flow execution should be present on the Agent machine or should be available in a shared location and shared location must be accessible to the user account under which Agent service is running.
- Database Connections: If you are trying to connect to the database or Excel using ODBC then please remember to use System DSN as shown below.
Configuration & Maintenance
Hardware and software configurations must be optimum and Agent machine should be monitored and maintained to achieve the best outcomes, here are few tips regarding the same:
- Optimum hardware configurations: Ensure your agent machines are having proper hardware and software configuration needed for flow execution, following article consists of suggested configurations for Agent machine.
- The application under test configuration: Application under test must be configured properly so that it gives intended behavior in the Agent machine.
- Refresh agent machine daily: Restart your Agent machines on daily basis to ensure that your Agent operating system is not consuming memory due to the opening of unnecessary applications under and this will help in the reset of the process which is hanged or not responding. Machine restart helps you reap all of the benefits of updates, fresh RAM, and cleared processes without any of the hassles!
- Remove unnecessary applications and files: Uninstall unnecessary memory consuming application from agent machine to get the best out of it in terms of performance.
Automatic updates when enabled, you always get the latest security patches and bug fixes automatically as soon as they're available, which is the most secure choice. However, the machine will sometimes get automatically rebooted to apply the updates leading to a couple of minutes of downtime in the middle of the flow execution. This is extremely critical when it comes to flow execution as a large number of tests will fail with even a small downtime. Here are a few practices that should be followed for Automatic Updates:
- Windows updates: It is recommended not to set the Windows Update to download and install updates automatically. A better approach is to download updates automatically but apply them explicitly e.g. at midnight or when your machine is scheduled to reboot. There are a number of ways to accomplish this automation, from PowerShell scripts to Software Update Services (SUS). You can develop routines to automate as much of the update process as possible.
- Turn off Automatic browser updates: Since the Web test cases are executed using selenium, it's very important to have the consistency of the browser version with a corresponding compatible driver version. Nowadays the browser version is updated very frequently, as a good practice we should turn off automatic updates so that the binaries i.e. the selenium driver for each browser doesn't mismatch. You can plan a regular update policy for the browser with which you can update the drivers also.
For any specific query, please contact our Priority Support.