Giter Club home page Giter Club logo

hands-on-with-selenium-auto-scaling-using-docker-and-zalenium's Introduction

Auto-Scaling Selenium Grid with Docker and Zalenium

Accessing Your Machine

We will provide you with a machine IP address which is your Ubuntu Virtual Machine (VM) for the duration of tonight's DevOps Playground.

  1. To access your machine first open a Terminal/Command window and enter the following command: ssh [email protected]

  2. You will be asked about whether you wish to proceed, type yes and press return.

  3. You will be prompted for a password. The password for all machines is playground.

What Have We Already Set Up On Your Ubuntu VM?

Installing Zalenium and Docker-Selenium

To install Zalenium and Selenium for Docker.

  1. To install docker-selenium run the following command in your ssh session: docker pull elgalu/selenium

  2. To install Zalenium, run the following command in your ssh session: docker pull dosel/zalenium

Running Zalenium

  1. In your ssh terminal/command window enter the following:

    docker run --rm -ti --name zalenium -d -p 4444:4444 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /tmp/videos:/home/seluser/videos \
    --privileged dosel/zalenium start
    

    The above command runs Zalenium and points your tests towards port 4444.
    It allows Zalenium to create more Selenium Grid docker containers.
    It sets a local temporary location for videos to be saved.
    Running it privileged is optional, but it does help to speed up the registration of containers.

  2. After a few seconds, in your browser on your local machine, access http://yourIp:4444/grid/admin/live?refresh=5. You should see two Selenium Grid containers with one instance each of Firefox and Chrome. This is by default.

Running Zalenium - Running a Selenium Test

  1. You first want to create a directory for the Playground repository to be pulled into. Enter the following command into your ssh session:
    mkdir myProject

  2. Change directory to your 'myProject' folder:
    cd myProject

  3. We now want to clone the DevOps Playground repository into our new folder within our ssh session. Perform the following:
    git clone https://github.com/ecsdigital/devopsplayground-edi-8-zalenium.git

  4. You now want to change directory into the devopsplayground repository you just cloned.
    cd devopsplayground-edi-8-zalenium

  5. To run the tests, enter the following command ./node_modules/.bin/wdio wdio.conf.js

  6. Whilst this is running, you can observe the number of Selenium Grid containers being created at: http://yourIP:4444/grid/admin/live?refresh=5 as the tests are being run.

  7. Once the tests are finishing you can observe, on the same page, the number of instances scale down.

  8. You can also view recorded videos by accessing http://yourIp:4444/dashboard. This provides you with a history of the tests which have been run and their status.

  9. To view logs for each test, click on the instance from the left hand menu. From there you can view a video recording of the test as well as Selenium and Browser log information.

Closing Zalenium

  1. Once your tests are finished you will probably want to shut down Zalenium. To do this enter the following command: docker stop zalenium

To verify that this has closed correctly, access the Console page here: http://yourIp:4444/grid/console . You should have a page not found error.

hands-on-with-selenium-auto-scaling-using-docker-and-zalenium's People

Contributors

alihill avatar marklehmann26 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.