Adding and Configuring New Agents

In this short tutorial, we show how to quickly implement a simple browser-based load test based on Cypress scripts in Step.

Illustration for Adding and Configuring New Agents

Step’s architecture allows for the dynamic registration of agents. It is designed to handle hundreds of agents, enabling the execution of keywords at a high rate. Different types of agents have been released in order to support tight integration with different runtimes. For example, DLL-based keywords can run on the .NET agent, while a Node.js project can be executed on Step’s node agent.

Step’s default routing will guarantee a natural affinity between a keyword’s given type and the agent on which this keyword’s execution will occur. However, users can define arbitrary affinity patterns allowing for further customization. For example, one may decide to assign a specific set of agents to a group that will work in isolation from the other agents, depending on contextual information provided at runtime.

In this tutorial, we will cover the configuration of an agent and how to design groups based on affinity patterns. We will also look at the different options users have to design and implement complex keyword routing rules.

‍Configuration file

All of Step’s agents use the same type configuration file - AgentConf.json - which should look similar to this by default:

  {
"gridHost":"http://localhost:8081",
"registrationPeriod":1000,
"workingDir":"../work",
"tokenGroups":[
{"capacity":10, 
"tokenConf":{
	"attributes":{ "myAffinityCriterion1" : "myAffinityValue1"},
  "properties": {
    "myProp1": "myValue1"
  }}
}
],
"properties":{
	"myProp1":"myDefaultValue",
	"myProp2":"myValue2",
	"plugins.jmeter.home":"../ext/lib/jmeter",
	"plugins.selenium.libs.2.x":"../ext/lib/selenium/selenium-2.53.1",
	"plugins.selenium.libs.3.x":"../ext/lib/selenium/selenium-java-3.0.1"}
}
  

You are probably already familiar with the gridHost parameter, which allows the agent to connect and register against a controller.

The tokenGroups parameter exposes a collection of pools that can be tagged with different key-values (via the properties sub-map).

  • The sub-map, called attributes, can be used to tag a certain pool with key-values and allows for a distinction between this pool and other pools belonging to the same agent, or to other agents from the same technical type.
  • The sub-map called properties allows users to set specific property values which will only be visible in the context of a token originating from this pool.
  • This means that keywords may “see” different property values depending on which token they end up being executed on.

The capacity parameter determines how many “tokens” (i.e keyword execution slots) will be made available in the corresponding pool upon starting the agent.

Note Not to enable more tokens than the underlying host is capable of servicing based on its allocated infrastructure resources (CPU, Mem, I/O…).

Lastly, a separate properties map allows the declaration of global agent properties which are made accessible to keywords and will look the same to every keyword executing on the agent, assuming the property is not overridden within the property map of the pool.

Token Pool Attributes

In the sample file provided above, the attribute “myAffinityCriterion1” is set on the only pool which has been configured, and the value “myAffinityValue1” has been assigned to it. This means that keywords may or may not be routed to this token pool depending on selection criteria which will be evaluated at runtime.

These criteria can be decided either by setting the corresponding variable in the plan, in the Routing map of a CallKeyword instance or of a Session instance, or via the route_to_XYZ variable, which can itself be set as a parameter and be manipulated dynamically.

Token Pool properties

In the sample file provided above, the dummy property “myProp1” is set on the only pool which has been configured, and it takes the value “myValue1”. This means that keywords running in the context of tokens belonging to this pool will see this value when accessing the property:

  properties.get("myProp1");
// myValue1
  

Routing examples

Assuming that in the following examples we have installed and started two agent pools (which may or may not be running on the same agent and/or host) using the attribute “myAffinityCriterion1” as a distinguishing criterion. Values “myAffinityValue1” and “myAffinityValue2” have been assigned respectively to token pools 1 & 2.

Explicit keyword routing

Both the CallKeyword (i.e the underlying object created when using a keyword in a plan) and Session artifacts showcase a section called “Keyword routing”. This section exposes a map of desired attributes which will be matched at runtime against the actual attributes of the tokens available for selection.

If we set our criterion “myAffinityCriterion1” to the value “myAffinityValue2”, then this keyword’s execution will only be able to take place on the corresponding pool and agent:

Upon execution, the details pane confirms this. If you look at the url of the agent taking care of the execution, you will see that it is the url of agent 2, as expected:

Implicit routing

The same result can be achieved using the reserved variable routeto. This variable can be set as a central parameter and overridden in a plan where necessary.

After removing the explicit routing key and value from our keyword call, we’ll apply a similar constraint with the routeto variable by appending the criterion to its name and setting the value as a parameter value.

Reminder, the execution will take place on agent 2

Let’s now override this value from within the plan by using a set artifact from within the plan, just before the keyword is effectively called.

This time, the execution took place on agent 1.

Summary: This article details the configuration of an agent, as well as how to design groups based on affinity patterns; it also lists the different options users have to design and implement complex keyword routing rules.

Illustration for Using Step with Grafana
Using Step with Grafana

This article demonstrates how to connect Grafana to data generated by Step.

Illustration for Setting up system monitoring with a Step agent
Setting up system monitoring with a Step agent

This article demonstrates how to set up distributed system monitoring using Keyword executions, and analyze the results as measurements.

Illustration for NET tutorials: Microsoft Office automation with Step
NET tutorials: Microsoft Office automation with Step

This tutorial demonstrates how to automate interaction with Microsoft Office applications using the Office Interop Assembly.

Illustration for JUnit Plan Runner
JUnit Plan Runner

This article provides documentation for how to integrate JUnit tests into Step.

Illustration for How to monitor services availability and performance
How to monitor services availability and performance

This tutorial demonstrates how Step can be used to monitor services, availability and performance metrics.

Illustration for .NET tutorials: AutoIt with Step
.NET tutorials: AutoIt with Step

This tutorial demonstrates how to utilize the AutoIt C# binding to automate interactions with Windows applications.

Illustration for Android Testing using Step and Appium
Android Testing using Step and Appium

This article demonstrates the automation of mobile applications on Android using the Appium framework.

Illustration for Browser-based automation with Step and Selenium
Browser-based automation with Step and Selenium

This article defines three Keywords which will be used in browser-based automation scenarios, using Step and Selenium, as general drivers.

Illustration for Load Testing with Cypress
Load Testing with Cypress - advanced

This tutorial shows you how to efficiently set up a browser-based load test using existing Cypress tests in the Step automation platform.

Illustration for Load Testing with Playwright
Load Testing with Playwright using Step UI

This tutorial shows you how to set up a browser-based load test using existing Playwright tests in the Step UI.

Illustration for Basic Keyword Development
Basic Keyword Development

This article explains Keywords in Step and demonstrates how to create simple ones.

Illustration for Designing functional tests
Designing functional tests

This tutorial demonstrates the design, execution, and analysis of functional tests using the web interface of Step.

Illustration for Robotic Process Automation (RPA) with Selenium
Robotic Process Automation (RPA) with Selenium

This tutorial will demonstrate how to use Step and Selenium to automate various browser tasks.

Illustration for Robotic Process Automation (RPA) with Cypress
Robotic Process Automation (RPA) with Cypress

This tutorial demonstrates how to use Step and Cypress to automate various browser tasks.

Illustration for Synthetic Monitoring with Selenium
Synthetic Monitoring with Selenium

This tutorial demonstrates how Selenium automation tests can be turned into full synthetic monitoring using Step.

Illustration for Load Testing with Cypress
Load Testing with Cypress

In this tutorial, you'll learn how to reuse existing Cypress tests to quickly set up and run a browser-based load test using the automation as code approach.

Illustration for Load Testing with Cypress
Load Testing with Serenity BDD and Cucumber

In this tutorial, you'll learn how to reuse existing tests written with Serenity BDD and Cucumber for load testing.

Illustration for Synthetic Monitoring with Cypress
Synthetic Monitoring with Cypress

This tutorial demonstrates how Cypress automation tests can be turned into full synthetic monitoring using the automation as code approach.

Illustration for Load Testing with Cypress
Load Testing with Cypress using Step UI

In this tutorial, you'll learn how to reuse existing Cypress tests to quickly set up and run a browser-based load test using the Step UI.

Illustration for Load Testing with Selenium
Load Testing with Selenium

This tutorial demonstrates how to leverage existing Selenium tests to set up and execute browser-based load tests, following a full code-based approach.

Illustration for Load Testing with Selenium
Load Testing with Selenium using Step UI

This tutorial demonstrates how to set up a browser-based load test in the Step UI using existing Selenium tests.

Illustration for Synthetic Monitoring with Playwright
Synthetic Monitoring with Playwright

This tutorial demonstrates how Playwright automation tests can be turned into full synthetic monitoring using Step.

Illustration for Synthetic Monitoring with Cypress
Synthetic Monitoring with Cypress using Step UI

This tutorial demonstrates how Cypress automation tests can be turned into full synthetic monitoring using the Step UI.

Illustration for Robotic Process Automation (RPA) with Playwright
Robotic Process Automation (RPA) with Playwright

This tutorial will demonstrate how to use Step and Playwright to automate various browser tasks.

Illustration for Load Testing with Playwright
Load Testing with Playwright for Java

In this tutorial, you'll learn how to reuse existing Playwright tests written in Java to quickly set up and run a browser-based load test using the automation as code approach.

Illustration grafana devops tutorial
Continuous load testing with K6

Quickly integrate K6 based load-tests in your DevOps workflow

Illustration for playwright synthetic monitoring in a devops workflow
DevOps Synthetic Monitoring with Playwright - Advanced

This tutorial demonstrates how Playwright tests can be reused for synthetic monitoring of a productive environment in a DevOps workflow

Illustration for playwright synthetic monitoring in a devops workflow
DevOps Synthetic Monitoring with Playwright

This tutorial demonstrates how Playwright tests can be reused for synthetic monitoring of a productive environment in a DevOps workflow

Illustration for okhttp devops
Protocol-based load testing with okhttp

In this tutorial you'll learn how to quickly set up a protocol-based load test with okhttp

Illustration for playwright devops
Continuous end-to-end testing

Learn how to set up continuous end-to-end testing across several applications based on Playwright tests in your DevOps pipeline using Step

Illustration for playwright devops
Continuous load testing with Playwright

Learn how to quickly set up continuous browser-based load testing using Playwright tests in your DevOps pipeline

Want to hear our latest updates about automation?

Don't miss out on our regular blog posts - Subscribe now!

Image of a laptop device to incentivize users to subscribe