This page is primarily dedicated to automation using ID-based licenses in SLM. Furthermore, it also explores the capabilities of test runner utilities and provides information on how to utilize TestEngine and Docker Image to enhance test functionality.
Runner utilities provided with ReadyAPI
ReadyAPI comes equipped with versatile test runner utilities that allow seamless integration of functional tests into your development process. These utilities enable you to execute tests from your preferred continuous integration (CI) and build tools, streamlining testing and deployment workflows. There are runners for:
-
Functional Tests – Automates the execution of functional tests to ensure the correctness of API endpoints and application behavior.
TestRunner allows you to run ReadyAPI functional tests and export results.
Location – Find the runner in the
<ReadyAPI>/bin directory
. The file name istestrunner.bat
(Windows) ortestrunner.sh
(Linux and macOS). -
Security Tests – Facilitates the automated execution of security tests, verifying the API's resistance to potential vulnerabilities and attacks.
Security TestRunner allows you to run ReadyAPI security tests from the command line.
Location – Find the runner in the
<ReadyAPI>/bin directory
. The file name issecuritytestrunner.bat
(Windows) orsecuritytestrunner.sh
(Linux and macOS). -
Performance Tests – Enables automation of performance tests, assessing API response times, scalability, and resource utilization under varying workloads.
Performance TestRunner allows you to run ReadyAPI load tests and exports results as configured. You can use it to run load tests from the command line.
Location – Find the runner in the
<ReadyAPI>/bin directory
. The file name isloadtestrunner.bat
(Windows) orloadtestrunner.sh
(Linux and macOS). -
Virtual Services – Automates the execution of virtual services, which allows developers to simulate API behavior for testing and development purposes.
VirtRunner allows you to run virtual APIs (virtual services) from a command line.
Location – Find the runner in the
<ReadyAPI>/bin directory
. The file name isvirtrunner.bat
(Windows) orvirtrunner.sh
(Linux and macOS).
You can start the runner from the command line or from the ReadyAPI user interface. The latter approach is useful, when you need to build the command line and check the settings. |
Running automated tests headlessly
For situations where the testing environment lacks a graphical user interface (UI), ReadyAPI offers different options to manage licensing for automated tests. To run ReadyAPI in a headless mode or in CI/CD build runs, you need floating licenses (online or offline) with virtual machines and Docker.
You cannot use UI based automation scripts on headless machine. |
Using ID-based licensing
Connecting to the SmartBear Hosted License Server (Online)
To run ReadyAPI in a headless mode or in CI/CD build runs, you need to specify the SmartBear account to be used for the execution by adding certain parameters to the command line.
Activate with Access Key – Get the access key from the SmartBear Licensing Portal and use it as a command-line parameter, either as -accessKey
or -K
.
For complete information, refer to this page.
Note: | SmartBear License Management's license authentication and request flows were revised in November 2023. Authentication using the username and password is no longer supported for test execution via TestRunners, Jenkins or Azure plugins, and SmartBear-hosted licenses. Username and password are limited to on-prem-hosted licenses only. Access Key is the required option for authentication if using SmartBear-hosted licenses headlessly. |
Connecting to a License Server Hosted in Your Network (Offline)
To run ReadyAPI in a headless mode or in CI/CD build runs in private network, you need to install or run an on-premises license server. Before using ReadyAPI in headless mode, the required license must be exported to the on-premises server using the server fingerprint file.
To configure and run headless commands, you can use test runners for Functional, Performance, Security, and Virtual Service testing. The main parameters to specify here are:
-
Server Address
-D licenseApiHost=SLM_License_Server_Address
-
Server Port
-D licenseApiPort=SLM_License_Server_Port
Once you add both parameters to connect to the on-premises server, you need to include an additional argument to authenticate the user using any of the following approaches.
-
Add AccessForEveryone flag – If you enable Access for Everyone on SLM on-premises, you no longer need to add Access Key credentials to your command line.
In that case, you can add the
-D licenseApiAccessForEveryone=true
flag to your CLI command. -
Add Access Key – We recommend you add the license access key as a parameter in the command line.
Use the
-accessKey
command-line parameter (or-K key
for short). -
Add Email Credentials – Alternatively, once the correct license is assigned to the Test User, you can configure the test runners using your credentials (in email format).
Use the
-email
or-U
) and-password
or-V
for short). -
Add Client Credentials – Once the SLM Onpremise License Server is configured for OIDC and the correct license is assigned to the Test User, you can configure the test runners using your credentials.
Use the
--clientId, -ci
<Client ID> and--clientSecret, -cs
<Client Secret>Specifies the Client ID and Client Secret respectively for SLM On-premise license Server when configured for OIDC. Please see here for instructions on configuring SLM on-premise for OIDC and how to access the credentials.
Note: SLM on-premise 2.0 or later must be configured for the OIDC/Okta environment.
For complete information, refer to this page.
Note: |
When using email and password credentials with the testrunner.sh and testrunner.bat scripts, they default to search for the service account via the "mail" attribute instead of the standard "sAMAccountName." This means users can successfully log in with the Service Account through the Web UI but not with the testrunner. Customers using LDAP might find that email addresses in Active Directory are stored under the "email" attribute rather than the "mail" attribute. You can configure SLM On-prem to search for the |
Using Access for Everyone with Headless Testing in Private Networks
There are 2 authorization approaches:
-
Add flag to CLI command – If you enable Access for Everyone on SLM on-premises, you no longer need to add Access Key credentials to your CLI command configuration for TestRunner, Performance Load Runner, Security Test Runner, and VirtRunner.
In that case, you can add the
-D licenseApiAccessForEveryone=true
flag to your CLI command. -
Add Access Key to CLI command – If you enable Access for Everyone on SLM on-premises and also need to use Access key credentials to your CLI command configuration, follow the below steps:
-
Request and install On-Premises Server on your headless machine.
-
Log in with the following credentials:
- username: anonymous.user
- password: <any, but cannot be left blank>
- In the top right corner of the On-Premise License Server UI, select > Access Key and copy the access key in the subsequent dialog.
- Use the access key in your command line configuration as specified in your product's documentation.
-
Using file-based licensing
Please note that starting October 2023, ReadyAPI will no longer provide file-based licensing and transition to SmartBear ID-based licensing. The SmartBear ID-based license model offers greater reliability and convenience, and users are encouraged to transition over. You should immediately engage with your SmartBear Account Manager to understand the steps involved in transitioning and getting started. Please read here to learn more.
Note: |
On the on-prem server, the DESKTOP token expires after 4 weeks, regardless of usage. To ensure uninterrupted work, replace the value of the authToken (i.e., "DESKTOP" token) with an Access Key. Additionally, update the authToken in both the For instance, update smarbear.auth, TestComplete/TestComplete.auth, and TestExecute/TestExecute.auth files accordingly. |
Docker Image
A ReadyAPI TestRunner Docker image can be used to execute functional tests. Follow the steps below to set up and use ReadyAPI with Docker:
-
Get the Functional Test Docker Image – Pull the ReadyAPI Functional Test Docker Image from Install Docker image with SoapUI TestRunner.
-
Project Setup – Place the project in the preferred folder such as
"C:\TestDocker\Projects"
-
Assign Test License – Ensure that you assign the Test or Bundle license to the Test User as per the outlined guidelines.
-
Request Access Key – Request the Get Access Key for the Test User on the on-prem server.
-
Run the Docker Container – Execute the following command in the console.
For complete information, refer to this page.
TestEngine
TestEngine is a standalone runner of ReadyAPI functional tests. You can install it on a dedicated machine in your network and use it as a central hub that runs all the ReadyAPI functional tests in your team. Please see more on this topic here.