This topic provides an example of how you can use Docker containers to run a
Silk4J test set on
Google Chrome on a Linux machine with Apache Ant. Before you can run the test set, you have to perform the following tasks:
- Install Docker on your machine.
- Prepare your
Silk4J project for executing tests with Ant. For additional information, see
Replaying Tests with Apache Ant.
- Copy the project to your Linux machine, for example to
/home/<user name>/projects/InsuranceWeb.
To run the
Silk4J test set on
Google Chrome.
-
Pull the latest version of the involved images to your registry.
For our example, we need the following three images:
- The latest
Silk Test image.
docker pull functionaltesting/silktest:latest
- The latest
Google Chrome image.
docker pull selenium/standalone-chrome:latest
- The Ant container that should run the tests.
docker pull webratio/ant:latest
-
Create a virtual Docker network to enable the Docker containers to communicate with each other.
For our example, name the network
my-network.
docker network create my-network
-
Start the
Google Chrome Docker container.
docker run --network my-network --name chrome selenium/standalone-chrome:latest
-
Start the Open Agent Docker container.
docker run -e SILK_LICENSE_SERVER=<license-server address>
-e SILK_LOG_FILE_PATH=/logs
-v /home/<user name>/projects/logs:/logs
--network my-network
--name agent
functionaltesting/silktest:latest
For additional info on the available environment variables, see
Silk Test Image Environment Variables.
-
Start the Ant Docker container to run the tests.
docker run -v /home/<user name>/projects/InsuranceWeb:/tmp/project
--network my-network
--name=test-runner
-it webratio/ant:1.10.1 ant
-DagentRmiHost=agent:22902
-Dsilktest.configurationName="host=http://chrome:4444/wd/hub;platformName=Linux - Chrome"
-buildfile /tmp/project/build.xml runTests
-
View the test results under
/home/<user name>/projects/logs.
-
Optional: To cleanup your test environment, execute the following commands: