TABLE OF CONTENTS
3. Executing Selenium Scripts on Windows
3.1 Setting the Browser Type in the Application Settings File
3.2 Adding the Docker files into the algoQA script generated folder
1. Overview
Docker is an open source platform that helps you in developing, shipping and running applications. Docker allows you to package and run applications in a loosely isolated environment known as a container.
When working with Docker, you create and use images, containers, and various other components.
A container is an operational instance of an image that can be executed. For more information, refer to Docker Overview document.
2. Installing Docker
To install Docker Desktop installer for windows, click here.
3. Executing Selenium Scripts on Windows
3.1 Setting the Browser Type in the Application Settings File
Perform the following:
After generating the script, download it to your local folder. This folder must contain the script file that you have generated.
- Open the folder where you downloaded the script. For example, if your script is located at AlgoAFScript_202402121131\src\test\java, navigate to this folder. Applications.xml file will be available in the Java folder as shown:
- Open the Application Settings file and locate the setting related to the Browser Type. Set this setting to Headless Chrome to run the script in the headless mode, as shown:
3.2 Adding the Docker files into the algoQA Script Generated Folder
Perform the following:
Download the attached Docker file which creates an environment in a Docker container for running Maven tests using Cucumber. This Docker file creates an image and adds the required files and helps in running the container.
Navigate to the Downloads folder > open the Docker file and save the Docker file into same folder where your script is generated, as shown:
3.3 Running the Container
To the run the container, you need to first build the Docker image and then execute the Docker image.
Perform the following:
- To build the docker image, run the following command in the command prompt:
docker build -t <name>. Replace name with actual name (for example, test1). This command builds an image, as shown:
- To verify if the image has been created successfully, run the following command in the command prompt:
Docker images
The following screenshot represents the docker image created, as shown:
- To execute the docker image, run the following command in the command prompt:
docker run <image name>. Replace image name with the actual name (for example, test1, as shown). This command executes the Docker image and downloads all the necessary dependencies'.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article