Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dockerize your tests

Dockerize your tests

This session talks about docker container and images, how to write a docker file, run a container, create one's own image, and run selenium tests on docker container.

abinayasakthi

February 03, 2017
Tweet

More Decks by abinayasakthi

Other Decks in Technology

Transcript

  1. What are we covering today • Why Docker? • How

    is docker different from normal VMs? • Docker objects • Few Docker commands • Demo on using Selenium in a docker container to run the tests 2
  2. Why do we dockerize tests ? Portability across machines Parallelise

    tests Optimal resource sharing. Cross Browser testing with available resources Component reuse Version control made easy Quickly create environments Consistent Systems 6
  3. Component Reuse UBUNTU Selenium JAVA Base Image 1GB 10GB 10GB

    10GB 10GB Guest OS, Java, Selenium, Browser
  4. Docker Images - An image is a file system and

    parameters to use at runtime - A file that's essentially a snapshot of a container 1 2
  5. Container 1 Container 2 Container n Image You can have

    many running containers of the same image.
  6. Few Docker commands 1 5 docker search ubuntu docker pull

    ubuntu docker images docker ps docker ps -a docker logs docker rmi
  7. Dockerfile A recipe which describes the files, environment, and commands

    that make up an image 1 6 Container RUN BUILD Docker File ……… …… …. Image
  8. Run the Docker Selenium image “docker run -d -p 4444:4444

    selenium/standalone-chrome” Pull the image from Docker registry and run the container Use the available image to run the container s.docker.com/engine/getstarted/stp_one 2 1 Is the image available in local?
  9. Test Scenario - Instantiate a remote webdriver - Open a

    google search page - Check page title - Search for “Hello World” - Take and save screenshot 2 2