Configure TestEngine
TestEngine general settings
TestEngine API allows you to view and modify the following settings:
You can edit them by using TestEngine API or Web UI.
Configuring via API
View settings
To get the current TestEngine settings, use the following command:
GET http://<testengine-host>:8080/api/v1/settings
See details on SwaggerHub in the ReadyAPI TestEngine API – Get Server Settings section.
Set settings
To modify TestEngine settings, use the following command:
PUT http://<testengine-host>:8080/api/v1/settings
See details on SwaggerHub in the ReadyAPI TestEngine API – Update Server Settings section.
Configuring via Web UI
Go to the home page of TestEngine:
http://<testengine-host>:<port>/
For example, if TestEngine is installed on your local machine and you run it on the default port, use the following link:
http://localhost:8080/
Open the Server tab and modify the needed settings:
To Add a new entry to a list, click Add New Path or Add New Target and specify the needed path or connection target.
To remove an entry from a list, click
.
Change connection settings
To change the default TestEngine connection settings (the protocol and port), edit the readyapi-testengine.yaml
configuration file in any text editor.
Important
We do not recommend that you modify other settings in the file, since it may cause errors.
The file location depends on the operating system and on the permissions TestEngine or its installer has:
Windows
<user folder>/.readyapi/readyapi-testengine.yaml
Linux and macOS
If you installed TestEngine or ran it with root access:
/etc/readyapi-testengine.yaml
If you installed TestEngine without root access:
/.readyapi/readyapi-testengine.yaml
Important
You need to restart TestEngine after modifying the file to apply the changes.
readyapi-testengine.yaml | Comments |
server: applicationConnectors: | TestEngine connection settings. |
- type: http port: 8080 | These settings configure connections established through the HTTP protocol. Integer. The port TestEngine will listen on for HTTP requests. Default: |
#Uncomment these settings to enable communication with TestEngine through the HTTPS protocol. # - type: https # port: 8443 | Integer. The port the service will listen on for HTTPS requests. Default: |
# keyStorePath: example.keystore | The path to the Java keystore containing the TestEngine certificate. |
# keyStorePassword: example | The password for accessing the keystore. |
# validateCerts: false | Whether TestEngine validates certificates. If it is true, TestEngine will not start if the certificate has expired or is invalid. |
Groovy restrictions
By default, Groovy scripting has limitations on writing data to properties and files. If you need fully functional Groovy scripts in your tests, you can turn off these restrictions.
Important
Turning off the restrictions can cause security vulnerabilities.
To turn off the limitations, you need to set the groovy.allow.all
system property to true. The way you do this depends on how you run TestEngine:
Executable file
Go to the TestEngine installation folder.
Open the
ReadyAPITestEngine.vmoptions
file in any text editor.Add the following line at the end of the file:
-Dgroovy.allow.all=true
Important
The last line in the
.vmoptions
file must be followed by a new line.Save the file and restart TestEngine.
Command line
When you use the .bat
or .sh
file to run TestEngine, add the system property to the script file:
Open the script file (
readyapi-testengine.bat/sh
).Go to the last but one line and insert the system property between the
JAVA_OPT
variable and the-cp
option:.bat file:
"%JAVA%" %JAVA_OPTS% -Dgroovy.allow.all=true -cp "%CLASSPATH%" com.smartbear.ready.testserver.ReadyApiTestServerMain %*
.sh file:
"$JAVA $JAVA_OPTS -Dgroovy.allow.all=true -cp $READY_API_CLASSPATH com.smartbear.ready.testserver.ReadyApiTestServerMain "$@"
Docker
If you run TestEngine in a Docker container, pass the system property to the JVM_OPT_GROOVY
environment variable:
Environment variable | Value |
---|---|
|
|
For example, if you use the docker run
command to start a container, add the -e JVM_OPT_GROOVY=-Dgroovy.allow.all=true
option to the command:
docker run -e JVM_OPT_GROOVY=-Dgroovy.allow.all=true -p 8082:8080 -it smartbear/readyapi-testengine
Relative Paths to Project Resources
By default, ReadyAPI uses absolute paths to files. This approach must change when you use the same test on multiple machines or share it with multiple users because not all of them will have the files you need in the same place. To solve this issue, use the Resource Root project property.
Please see here for instructions on how to configure the Resource Root project property.
Use alternative configuration file
By default, TestEngine uses the configuration file described above. You can make TestEngine use an alternative settings file.
To do this, run the TestEngine executable with the -c (--cfg) <arg>
argument. For example:
To avoid errors, copy the settings file to the needed place, then run TestEngine with the -c (--cfg)
option, and change settings by using web UI or API if possible.