MANOJ KUMAR KUMAR CONTAINER CAMP 2017-SYDNEY
BUILDING TEST-AUTOMATION INFRASTRUCTURE
VIA CONTAINERS
ABOUT ME
▸ Open source enthusiast
▸ Selenium member
▸ Author assertselenium.com
▸ Organizer seleniumconf.com
▸ Tweets: @manoj9788 | LinkedIn: manojkumar9788
CONTINUOUS DELIVERY
▸ It’s all about continuous delivery
Continuous Integration >
Continuous Testing >
Continuous Delivery
TEST AUTOMATION
▸ Browser Automation library
▸ A suite of tools
▸ JavaScript, Java, Python, C#, Ruby
▸ W3C candidate recommendation
SELENIUM-GRID
▸Hub
▸The intermediary and the manager
▸Allocates Test Slots to nodes
▸Takes instructions directly from client, and executes them remotely on nodes
▸Node
▸Registers itself to Hub listed in config
▸Communicates its config to the Hub at registration time:
▸Test Slots per browser

“Hey Hub, I have 1 Slot for Firefox, 5 for Chrome”
▸Receives JSON wire protocol instructions from the Hub
DISTRIBUTED TESTING
SELENIUM-GRID
CHALLENGES
▸ Tests start growing
▸ Parallelization reduces time
▸ VM’s are heavy and costly to maintain
Solution?
Docker Containers to rescue
‣ Light-weight
‣ All pre-requisites to run selenium tests are already packaged.
‣ Also for mobile..
https://github.com/SeleniumHQ/docker-selenium
Use Docker-compose to scale easily
DOCKER-SELENIUM
DOCKER-SELENIUM
▸ selenium/hub: Image for running a Selenium Grid Hub
▸ selenium/node-chrome: Selenium node with Chrome installed.
▸ selenium/node-firefox: Selenium node with Firefox installed.
▸ selenium/node-phantomjs: Selenium node with PhantomJS installed
▸ selenium/node-chrome-debug: Selenium node with Chrome installed and
runs a VNC server.
▸ selenium/node-firefox-debug: Selenium node with Firefox installed and runs
a VNC server.
All these images needs to be connected to a Selenium Grid Hub
DOCKER-SELENIUM IMAGES
https://github.com/manoj9788/kubernetes-docker-selenium - Star it! :)


Self-healing capability - helps restart the node when it goes down automatically, which helps in test
automation.



Scale containers - replicas
Use Helm package
$ helm install stable/selenium
KUBERNETES - SELENIUM

Test Automation Infrastructure with Containers

  • 1.
    MANOJ KUMAR KUMARCONTAINER CAMP 2017-SYDNEY BUILDING TEST-AUTOMATION INFRASTRUCTURE VIA CONTAINERS
  • 2.
    ABOUT ME ▸ Opensource enthusiast ▸ Selenium member ▸ Author assertselenium.com ▸ Organizer seleniumconf.com ▸ Tweets: @manoj9788 | LinkedIn: manojkumar9788
  • 3.
    CONTINUOUS DELIVERY ▸ It’sall about continuous delivery Continuous Integration > Continuous Testing > Continuous Delivery
  • 4.
    TEST AUTOMATION ▸ BrowserAutomation library ▸ A suite of tools ▸ JavaScript, Java, Python, C#, Ruby ▸ W3C candidate recommendation
  • 5.
    SELENIUM-GRID ▸Hub ▸The intermediary andthe manager ▸Allocates Test Slots to nodes ▸Takes instructions directly from client, and executes them remotely on nodes ▸Node ▸Registers itself to Hub listed in config ▸Communicates its config to the Hub at registration time: ▸Test Slots per browser
 “Hey Hub, I have 1 Slot for Firefox, 5 for Chrome” ▸Receives JSON wire protocol instructions from the Hub DISTRIBUTED TESTING
  • 6.
  • 7.
    CHALLENGES ▸ Tests startgrowing ▸ Parallelization reduces time ▸ VM’s are heavy and costly to maintain Solution? Docker Containers to rescue ‣ Light-weight ‣ All pre-requisites to run selenium tests are already packaged. ‣ Also for mobile..
  • 8.
  • 9.
    DOCKER-SELENIUM ▸ selenium/hub: Imagefor running a Selenium Grid Hub ▸ selenium/node-chrome: Selenium node with Chrome installed. ▸ selenium/node-firefox: Selenium node with Firefox installed. ▸ selenium/node-phantomjs: Selenium node with PhantomJS installed ▸ selenium/node-chrome-debug: Selenium node with Chrome installed and runs a VNC server. ▸ selenium/node-firefox-debug: Selenium node with Firefox installed and runs a VNC server. All these images needs to be connected to a Selenium Grid Hub DOCKER-SELENIUM IMAGES
  • 10.
    https://github.com/manoj9788/kubernetes-docker-selenium - Starit! :) 
 Self-healing capability - helps restart the node when it goes down automatically, which helps in test automation.
 
 Scale containers - replicas Use Helm package $ helm install stable/selenium KUBERNETES - SELENIUM