Run TestEngine with a Proxy
About
You may need to configure TestEngine to run with a proxy to support test execution and licensing requests. This page explains how to set up a proxy for TestEngine in various environments.
Configuring a Proxy via VMOptions
To configure a proxy using VMOptions, add the following flags to the ReadyAPITestEngine.vmoptions
file:
-Dhttp.proxySet=true -Dhttps.proxySet=true -Dhttp.proxyHost=theproxyhostgoeshere -Dhttp.proxyPort=411 -Dhttps.proxyHost=theproxyhostgoeshere -Dhttps.proxyPort=411
Configuring a Proxy in Docker
Passing System Properties
When running TestEngine in Docker, you can pass arbitrary command-line arguments to the Java process by defining environment variables prefixed with JVM_OPT_
.
Example: To set the server.port.http
configuration property, define an environment variable named JVM_OPT_HTTP_PORT
with the value -Dserver.port.http=XXXX
.
Adding Proxy Commands
To configure proxy settings for TestEngine in Docker, include the following environment variables in your docker run
command:
docker run \ -e TESTENGINE_RESET_ADMIN_ACCOUNT=true \ -e TESTENGINE_PASSWORD=P@ssw0rd123! \ -e JVM_OPT_HTTP_PROXYSET="-Dhttp.proxySet=true" \ -e JVM_OPT_HTTPS_PROXYSET="-Dhttps.proxySet=true" \ -e JVM_OPT_HTTP_PROXYHOST="-Dhttp.proxyHost=theproxyhostgoeshere" \ -e JVM_OPT_HTTP_PROXYPORT="-Dhttp.proxyPort=411" \ -e JVM_OPT_HTTPS_PROXYHOST="-Dhttps.proxyHost=theproxyhostgoeshere" \ -e JVM_OPT_HTTPS_PROXYPORT="-Dhttps.proxyPort=411" \ -it smartbear/readyapi-testengine
Warning
Ensure that proxy configuration allows access to SmartBear URLs for license requests. For guidance, see the SmartBear ID-based Licensing documentation.
Configuring a Proxy with the Command-Line Interface (CLI)
To configure a proxy for TestEngine using the CLI, refer to the following resources for detailed instructions:
CLI Documentation on npm: Access the TestEngine CLI documentation on npm for setup guidance.
ReadMe on GitHub: Review the TestEngine CLI ReadMe for examples and instructions specific to proxy configuration.
Configuring a Proxy with the TestEngine API
For configuring proxy settings via the TestEngine API, see the TestEngine API documentation.
Example Configuration
Here is an example docker-compose configuration for setting up a proxy with TestEngine:
version: '2' services: testengine: image: 'smartbear/readyapi-testengine:1.27.1' ports: - "8000:8080" environment: - ACCEPT_TOU=true - JVM_OPT_OPTIMIZELY=-DOptimizelyDisabled=true - TESTENGINE_PASSWORD=password - TESTENGINE_RESET_ADMIN_ACCOUNT=true - JVM_OPT_httpProxyHost=-Dhttp.proxyHost=172.17.0.1 - JVM_OPT_httpsProxyHost=-Dhttps.proxyHost=172.17.0.1 - JVM_OPT_httpProxyPort=-Dhttp.proxyPort=8080 - JVM_OPT_httpsProxyPort=-Dhttps.proxyPort=8080 - JVM_OPT_httpNoneProxyHosts=-Dhttp.nonProxyHosts="" - JVM_OPT_httpsNoneProxyHosts=-Dhttps.nonProxyHosts="" - JVM_OPT_GRACE_PERIOD=-Dtestengine.licenseGracePeriod=500 - JVM_OPT_SLM_PING_FREQUENCY=-Dslm.pingFrequency=5 volumes: - /home/jonathan/.readyapi:/data
Important Notes
Proxy Configuration for Tests and Licensing
You can configure TestEngine to handle tests and licensing differently with a proxy. For example, tests can bypass the proxy while licensing requests use it. Add the following line to the
ReadyAPITestEngine.vmoptions
file:-Dhttp.nonProxyHosts=mycompanys.domain.com
Ensure that domain names in your tests use fully qualified names (for example,
servername.mycompanys.domain.com
instead of justservername
).Syntax Sensitivity
TestEngine is sensitive to the syntax of JVM_OPTS. Double-check for accuracy when configuring these settings.