Scaling and Managing Selenium Grid
Dima Kovalenko@dimacus
• Note to self, this slide should be completely blank, NO TEXT of any sort!
Shameless Plug
ISBN: 9781783982707https://www.packtpub.com/web-development/selenium-design-patterns-and-best-practices
Explaining Grid
• Dumb Nodes
Explaining Grid
• Dumb Nodes• Even Dumber Hub
Hub is a Glorified Proxy Server
• HUB is an HTTP Proxy• That tracks node count– Does not know much else about nodes
Getting Priorities Right
• Stability• Speed• Coverage
Stability
• Become a Sys Admin
Stability
• Become a Sys Admin• Move as much to Linux as possible
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!
- At least for IE Safari
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!
- Shared resources at OS level
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!• Configuration as code– Git– Chef– Puppet
Configuration Management
• Node Configs– Grid Hub Configs– Grid Node Configs– Store In Git
Configuration Management
• Node Configs– Grid Hub Configs– Grid Node Configs– Store In Git
• OS Configs– Crons– Versions
• Browsers• Java• Etc..
Speed
• Smaller Nodes– Better to have 10 computers with 1 browser
• It’s ok to use low end machines
Speed
• Smaller Nodes– Better to have 10 computers with 1 browser
• It’s ok to use low end machines– Take performance hit in place of faster run time
Coverage
• Can we add IE6 and 7 to the Grid?
Coverage
Coverage
• More maintenance• IE8 takes 50% of free time
• IE9 or > is much Safer to use
International Buy Jim Evans a BEER day!
International Buy Jim Evans a BEER day!
International Buy Jim Evans a BEER day!
More On Stability
• Don’t Use RC– java -jar selenium.jar -role node
More On Stability
• Don’t Use RC• Use WebDriver–java -jar selenium.jar -role wd
More On Stability
• Replace Internet Explorer with Batch file• Create Crons (Scheduled Tasks)– Periodically Restart Grid node (JAR)– Periodically Restart Computer
More On Stability
• Replace Internet Explorer with Batch file– Cleans up Cookies, Cache, etc– Launches Internet Explorere
More On Stability
• Replace Internet Explorer with Batch file• Create Crons (Scheduled Tasks)• Auto login & Auto Start at login– Always auto login with the Build User
More On Stability
• Replace Internet Explorer with Batch file• Create Crons (Scheduled Tasks)• Auto login & Auto Start at login• Etc.. Etc.. Etc..
Selenium Grid Extras
• 1 year old
Selenium Grid Extras
• https://github.com/groupon/Selenium-Grid-Extras
Goal of the Project
• Document Grid Stability with code
Goal of the Project
• Document Grid Stability with code– (Poorly written Java code that is)
• Make the setup and maintenance of the grid simple
Features to improve stability
• Automatically Set IE Protected Security Zone each reboot
• Move the mouse out of the way• Kill web browser after Test• Kill chromedriver.exe and iedriver.exe after
build• Automatically update Drivers and JARS• Store config for all nodes in single place
Latest Features
• Restart node every X builds, when node is free• Jenkins Plugin• Video recording of test (Work in progress)
Optionally Reboot OS
• Windows reboot not optional!• Improves speed and test stability• Prevents this:
Video Recording
• (Work in Progress)
Demo
Jenkins Plugin
• (Work in Progress)
Find IE Crashes at a Glance
Questions?
Top Related