Zalenium and Selenium-as-a-Service
John Hill Automation Engineer - Ansible
Who am I?
Who am I?
Overview
- Zalenium
- Selenium-as-a-Service
- Live Demo! (What could go wrong?)
- $$$
- Leverage Zalenium in CI/CD
What is Zalenium?
Zalenium is a container-native Selenium Grid... with elastic scaling… with Selenium Grid Extras functionality… and the ability to route out to Selenium-as-a-Service Providers
Selenium
Send Test Requests (check that a searchbar is loaded) to manipulate or verify actions in a real browser on a real operating system.
Problems
- Not able to easily observe what's happening.
- Not everyone's OS and Browser version is the same when running tests.
- "It works on my machine"
Docker-Selenium
- Containerized
- Chrome and Firefox on linux
- Fixed at a certain version
- Immutable
Problems
- Very Few Browsers
- Concurrency
- Limited in Platform (only linux)
Selenium Grid (Extras)
- Various Browsers and Platform supported
- Various Versions of Browser supported
- Video recording!
- Single Hub!
Problems
- Difficult to maintain
- Difficult to keep nodes alive
- Manually update browser versions
Zalenium
Zalenium Docker Process
Isn't that just (containerized) Selenium Grid Extras?
- Point all incoming Selenium Tests at single Hub
- Control Many Browsers and Platforms
- (not shown) Video Recording
But wait! There's more!
Zalenium "Creates" Docker-Selenium Nodes
Zalenium "Proxies" to Se-as-a-Service
What is Selenium-as-a-Service?
Selenium Providers
- Browserstack
- Saucelabs
- TestingBot
What do they provide?
- Impossibly Large Browser/Platform Compatibility
-
https://bit.ly/2PFB4we
- Point all incoming Selenium Tests at single Hub
- Video Recording
- Screenshots
- <Insert Marketing Material Here>
So why use Zalenium?
Let's set it up!
Let's set it up!
Let's Use it!
Walkthrough
- http://0.0.0.0:4444/grid/console
- http://0.0.0.0:4444/grid/admin/live?refresh=5
- http://0.0.0.0:4444/dashboard/#
Demo Summary
- Demonstrate the UI in Zalenium
- Run any Selenium-based project on Zalenium
- Running local to your Zalenium node is faster than running in the cloud
- Run multiple tests in parallel
- Elastically provision selenium hosts
- Run locally and in the cloud simultaneously
- View Videos captured on both
What wasn't shown
- The ability to swap between Testingbot, Saucelabs, and Browserstack on the fly
- Running from CI (it's exactly the same)
- It can run on any Container platform or any Kubernetes platform out-of-the-box
- Connect any existing Selenium Grid Nodes to Zalenium Hub
- Tune various parameters
- Scaling! (Up to 1000 concurrent tests)
Cost Comparison
Pricing Overview
- It's all based on concurrency and minutes.
- Max of 24 Parallel Tests can cost $4800/month -- excluding Mobile
- Per Minute Pricing available
SaaS Comparison
Testing bot is always cheaper.
There are 43800 Minutes in a month (had to look that up)
SaaS vs Zalenium (on GKE)
Rule of Thumb: 1 Selenium Container needs 1 cpu and 1 GB Ram. 2 CPU if recording video
$0.20/minute vs $0.000792/minute standard or
Saucelabs is 25,252% more!
Even less if running preemptible nodes
How to Leverage the SaaS race to the bottom
No Vendor Lock-in
- Zalenium Runs anywhere (GKE, Docker, AWS ECS, Openshift).
- GKE is cheapest right now.
- Zalenium doesn't care about hosting Selenium-as-a-Service providers. It's a neutral endpoint with a proxy.
- Testingbot is cheapest for now... you can change anytime.
CI/CD Pipeline Design
- Only Run Multibrowser testing when necessary.
- Let Chrome/Firefox run first. If those succeed, then run the rest of the Matrix.
- Put your Zalenium cluster closest to your CI test executors. e.g. Jenkins Agents
- Don't run a matrix... run an array!
Matrix as an array
- Instead of running all the Browser/Platforms concurrently (and paying more money), run in serial.
- i.e. Pay $800/month for 4x Concurrent and the test runs take twice as long for half the cost of 8x
- Great if you want to run your tests at night
Conclusion
- Zalenium
- Selenium-as-a-Service
- Live Demo! (Something probably broke?)
- $$$
- Leverage Zalenium in CI/CD
Thanks!
Zalenium
By John Hill