MANOJ KUMAR KUMAR SELENIUM COMMITTER DAY, TOKYO !
AUTOMATED TESTING IN THE AGE OF CONTAINER CLUSTER
ABOUT ME
▸ Open source enthusiast
▸ Selenium member
▸ Author assertselenium.com
▸ Organizer seleniumconf.com
▸ Tweets: @manoj9788 LinkedIn: manojkumar9788
▸ Lives in Sydney, enjoys BasketBall and Kayaking
WHAT’S IN FOR TODAY?
▸ Today’s Technological scenario
▸ Test Automation using Selenium
▸ Selenium Grid
▸ Docker Containers
▸ Dockerize your functional tests
▸ Orchestration tools for containers
▸ Third party tools
TODAY’S TECHNOLOGY SCENARIO
▸ Time to Market
▸ Ship It as soon as possible
▸ Cost Optimization
▸ Compete with less cost
▸ Paradigm shift
▸ Constantly changing environment, CI, CD, DevOps
▸ Distributed computing
▸ Dockers, Cloud computing
CONTINUOUS DELIVERY
▸ It’s all about continuous delivery
Continuous Integration >
Continuous Testing >
Continuous Delivery
CONTINUOUS-INTEGRATION, TESTING, DEPLOYMENT & DELIVERY
Continuous Delivery != Continually delivering software
Continuous Delivery == Continuous production readiness
Continuous Deployment == Continually delivering software
DevOps is Not a Market, but a Tool-Centric Philosophy That Supports a
Continuous Delivery Value Chain
Thanks to Alister
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
▸ Agents are costly
Solution……
CONTAINERS TO RESCUE
‣ Light-weight
‣ All pre-requisites apps/libs are packaged.
‣ Also for mobile..
Docker Driven Development
Unified Infrastructure for Dev and Test
DOCKER CONTAINERS Vs VM’s
Analogy -
Apartment Villa
▸ Virtual Machine’s
▸ Includes Hardware simulation
▸ Can simulate only few VM’s per server
▸ Slower latency, takes time to load.
▸ Containers
▸ Based on Linux containers
▸ Lightweight - requires only few MB’s
▸ AUFS- Advanced Multi-Layered Unification File System
CONTAINERS VS VM’S
https://github.com/SeleniumHQ/docker-selenium
Dan Davison Leo Gallucci, Matt smith
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://HUB.DOCKER.COM/R/SELENIUM/
DOCKER-SELENIUM
DEMO TIME - SPIN UP SELENIUM GRID VIA DOCKER
DOCKERIZE YOUR TESTS : SHIP YOUR AUTOMATED
TESTS AS A CONTAINER
DOCKERIZE YOUR TESTS
NodeJs Java
docker build -t yourImageName .
DOCKERIZE YOUR TESTS
docker-compose.yml
MOBILES
APPIUM-DOCKER-ANDROID
https://github.com/appium/appium-docker-android
‣ Run tests on real device
‣ Connect to your existing Selenium Grid instance
‣ CONNECT_TO_GRID=True
‣ APPIUM_HOST=<ip_address_of_appium_server>
‣ APPIUM_PORT=<port_of_appium_server>
‣ SELENIUM_HOST=<ip_address_of_selenium_hub>
‣ SELENIUM_PORT=<port_of_selenium_hub>

DOCKER-ANDROID
https://github.com/butomo1989/docker-android
‣ Run tests in Android emulators
‣ VNC support
‣ Run UI tests for Android applications with different frameworks (appium, espresso, robotium)
‣ Connect to your existing Selenium Grid instance

ORCHESTRATION
▸ Automated arrangement, coordination, and management of
containers.
▸ Different tools out there…
DOCKER-SELENIUM IMAGES
CAPABILITIES OF ORCHESTRATION TOOLS
Self healing capability
Automatically brings up the containers if for some reasons it goes
down.
and much more….
https://github.com/manoj9788/kubernetes-docker-selenium


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



Scale containers - replicas
KUBERNETES - SELENIUM
Package Manager for Kubernetes
Use Helm package
$ helm install stable/selenium
KUBERNETES - SELENIUM
RECOMMENDED THIRD PARTY TOOLS BASED ON DOCKER-SELENIUM
Zalenium
https://github.com/zalando/zalenium

▸ Disposable and flexible docker-based Selenium Grid
▸ Live preview of tests running
▸ live dashboards(offline too)
▸ Integration of Cloud Testing solutions
▸ Run on Kubernetes (Beta!)
Aerokube
Selenoid
‣ ‘Go’ language implementation of Original(official) Selenium-Hub
‣ Docker based
‣ Re-use of containers
GridRouter
‣ Light-weight server routes requests to multiple hubs
‣ Scalable solution(1000+)
RECOMMENDED THIRD PARTY TOOLS BASED ON DOCKER-SELENIUM
http://docker.com
https://github.com/appium/appium-docker-android
https://github.com/seleniumhq/docker-selenium/
https://github.com/zalando/zalenium
https://github.com/aerokube/selenoid
https://blog.docker.com/2016/04/cicd-with-docker-cloud/
https://github.com/manoj9788/kubernetes-docker-selenium
REFERENCES
MANOJ KUMAR KUMAR @MANOJ9788
THANK YOU !

Automated-Testing-inside-containers