Presentation on how to build an infrastructure for running automated test suites using Docker, Jenkins and Zalenium (Selenium Grid in a docker container)
Recommended For: Any test engineer who wants a parallelization for running the automated tests using free sources technologies.
2. Contents
- Why the previous solution is not good enough
- The goals we’ve had when starting to think at a new solution
- How new solution achieves the goals we’ve set
- About Docker
- Zalenium
- Configuration and Demo
- Challenges
- Improvements & Feedback
3. Previous solution
- Jenkins installed on one machine and 3
virtual machines installed on a different
machine
- virtual machine = 1 node
- tests where sent in parallel to each node
- nr. of nodes = nr. of tests run in parallel
Disadvantages:
- difficult to set-up
- parallelism was created by the number of
virtual machines
4. Goals
- parallelize tests and reduce the time needed for testing
- reduce hardware resources
- quick up & running solution & easy to scale up
- allow developers to “jump in” and run tests whenever they need to
5. New solution
- Jenkins and slave nodes as containers
- fast start: `docker-compose up`
- scale up nodes very easy as necessary
`docker-compose up --scale slave=n`
- configure slave nodes with multiple
executors and send multiple tests to same
node in parallel
- use Zalenium to open on demand browsers
in docker containers
6. About Docker
- a software containerization platform
- a container is launched by running an image
- a container is an alternative to virtual machine
- an image is an executable package that includes everything needed to
run an application--the code, a runtime, libraries, environment
variables, a particular OS and configuration files
- Docker Compose is a tool for defining and running multi-container
Docker applications. With Compose, you use a YAML file to configure
your application’s services
9. Zalenium vs. Selenium grid
Challenges:
Setting up selenium grid & maintaining is not very easy:
● Downloading and setting up all the dependencies for
each node.
● Manually restarting the nodes in case of issues.
● Maintenance is expensive.
● Scalability issues.
10. Zalenium
- a grid that scales up and down dynamically
- opens/close browser containers/nodes (docker-selenium) on demand
- requested browser: Chrome/Firefox
- requested browser: IE/Safari -> if configured, request to BrowserStack,
SauceLabs
- records video with the test
- allows visual representation with opened containers
19. Why to use
- open source app
- allow anyone to have a flexible Selenium Grid infrastructure
- quick up & running solution
- easy to scale up
- reduce hardware resources