About
Docker runs applications in light-weight virtual containers. The containers provide you with a consistent environment isolated from other applications. SmartBear provides you with the ready-api-soapui-testrunner docker image you can use to run SoapUI functional tests within containers. The image is available in Docker Hub.
Docker image
To run functional tests in Docker, use the following image from Docker Hub:
https://hub.docker.com/r/smartbear/ready-api-soapui-testrunner/
Required license
To use the image, you must have a Floating license. When you run a container, it connects to the specified license server and obtains the license. The license server must be available to the container and must be properly configured. See Configure License Server 5.x.
Hardware requirements
This topic describes how to use Docker with ReadyAPI on the Hyper-V virtualization platform. To do that, use the same environment you use to run your Docker images. There are no specific requirements for this.
To learn more, see the Docker documentation:
To run ReadyAPI tools in Docker containers on other virtualization platforms, additional configuration may be required. Please see the corresponding documentation.
Known issue: You cannot run the ready-api-soapui-testrunner image by using the Docker toolbox.
Pulling Functional Test Runner image from Docker Hub
To run functional tests by using a Docker image, you need to pull it from Docker Hub. To do this, use the following command:
Docker command syntax
To run a functional test in a Docker container, use the following command line:
docker run -v="Project Folder":/project -v="Report Folder":/reports -v="Extensions Folder":/ext -e LICENSE_SERVER="License Server Address" -e COMMAND_LINE="Test Runner Arguments" -it smartbear/ready-api-soapui-testrunner:latest
Arguments
-v=Project Folder:/project
Usage:
-v="C:\Work\ReadyAPI Project":/project
Note: | On some systems, you may need to change the path in the following way:
"C:\Work\ReadyAPI Project" -> "/host_mnt/C/Work/ReadyAPI Project"
|
-v=Report Folder:/reports
Usage:
-v="C:\Work\Reports":/reports
Note: | On some systems, you may need to change the path in the following way:
"C:\Work\Reports" -> "/host_mnt/C/Work/Reports"
|
-v=Extensions Folder:/ext
Usage:
-v="C:\Work\ReadyAPI Extensions":/ext
Note: | On some systems, you may need to change the path in the following way:
"C:\Work\ReadyAPI Extensions" -> "/host_mnt/C/Work/ReadyAPI Extensions"
|
-v=Plugins Folder:/root/.soapui/plugins
Usage:
-v="C:\Users\<User>\.soapui\plugins":/root/.soapui/plugins
Note: | On some systems, you may need to change the path in the following way:
"C:\Users\<User>\.soapui\plugins" -> "/host_mnt/C/Users/<User>/.soapui/plugins"
|
-e LICENSE_SERVER="License Server Address"
Required. Specifies the address of the license server. When a container runs, it connects to the specified server to obtain a Floating ReadyAPI Test license.
Make sure the container is able to connect to the license server using the IP you specify, regardless of whether you use a public or private IP address.
Usage: -e LICENSE_SERVER="10.0.21.14:1099"
-e COMMAND_LINE="Test Runner Arguments"
Required. Specifies arguments for the test runner. The %project%
variable refers to the container folder to which the contents of the project folder were copied. To refer to the reports volume, use the %reports%
variable.
Usage:
-it
ready-api-soapui-testrunner:latest
Sample full command
Exit codes
After the docker stops running, you can get the exit code by using the following command:
Besides the standard Docker exit codes (see the Docker documentation) the ready-api-soapui-testrunner Docker image uses the following codes:
101 | Contained ReadyAPI cannot start due to a license issue. Make sure the license server is properly configured and the Docker image can access to it. See other possible issues with a floating license. |
102 | The ReadyAPI project was not found. Make sure you specify the correct folder for the project volume, and this folder contains the specified project.
|
103 | An error occurs during the test run. See the test log for more details. |
Run in Docker Compose
To add the Functional Test Runner image to your Docker Compose application:
-
Get the Functional Test Runner image's Dockerfile from GitHub (https://github.com/SmartBear/docker-soapui-testrunner) and put it somewhere in your Docker Compose project directory.
-
Open Dockerfile in any text editor. Uncomment the line that assigns the license server address to the
LICENSE_SERVER
environment variable and specify the host and port of your license server.Example:
ENV LICENSE_SERVER=10.0.22.12:1099Tip: If you configure other commands in the file, you will not have to specify the corresponding arguments when running the service. -
Open the docker-compose.yml file in your Docker Compose project folder and add the command to build a service from Dockerfile:
<service-name>:
build: <path>service-name
The name that will be assigned to the service.
path
The path to the directory in the project folder where Dockerfile is stored.
Example:
docker-compose.yml
version: '3'
services:
soapui-testrunner:
build: .
redis:
image: redis:latest
db:
image: postgres:9.4
volumes:
- db-data:/var/lib/postgresql/dataTip: For a reference on the docker-compose.yml file, see https://docs.docker.com/compose/compose-file/. -
Use the
docker-compose build
command to build the services specified in the docker-compose.yml file.
Now, when you run your Docker Compose application, the Functional Test Runner will be run as a part of it.
To run only the Functional Test Runner service, use the following command:
service-name
Note: For a reference on the rest of the arguments, see the Docker command syntax section above.
Troubleshooting
If you cannot run Docker due to the Drive has not been shared error, perform the following steps:
-
Right-click the Docker icon in the notification area and select Settings:
-
On the Shared Drives page of the Settings dialog, select all the drives you use to run the Docker container.
If your drives have already been shared, but the error occurs anyway, turn off sharing. After you apply the changes, repeat these steps to share the drives again.
To share your drivers, select them in the list and click Apply:
You may need to enter the credentials of your system account to apply the changes.
See Also
Docker Images
Configure License Server 5.x
VirtServer in Docker
LoadUI agent for Docker