Download - Scaling and Managing Selenium Grid
![Page 1: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/1.jpg)
Scaling and Managing Selenium Grid
Dima Kovalenko@dimacus
![Page 2: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/2.jpg)
• Note to self, this slide should be completely blank, NO TEXT of any sort!
![Page 3: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/3.jpg)
![Page 4: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/4.jpg)
Shameless Plug
ISBN: 9781783982707https://www.packtpub.com/web-development/selenium-design-patterns-and-best-practices
![Page 5: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/5.jpg)
![Page 6: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/6.jpg)
Explaining Grid
• Dumb Nodes
![Page 7: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/7.jpg)
Explaining Grid
• Dumb Nodes• Even Dumber Hub
![Page 8: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/8.jpg)
Hub is a Glorified Proxy Server
• HUB is an HTTP Proxy• That tracks node count– Does not know much else about nodes
![Page 9: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/9.jpg)
Getting Priorities Right
• Stability• Speed• Coverage
![Page 10: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/10.jpg)
Stability
• Become a Sys Admin
![Page 11: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/11.jpg)
Stability
• Become a Sys Admin• Move as much to Linux as possible
![Page 12: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/12.jpg)
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!
- At least for IE Safari
![Page 13: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/13.jpg)
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!
- Shared resources at OS level
![Page 14: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/14.jpg)
Stability
• Become a Sys Admin• Move as much to Linux as possible• Only 1 test at the time!• Configuration as code– Git– Chef– Puppet
![Page 15: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/15.jpg)
Configuration Management
• Node Configs– Grid Hub Configs– Grid Node Configs– Store In Git
![Page 16: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/16.jpg)
Configuration Management
• Node Configs– Grid Hub Configs– Grid Node Configs– Store In Git
• OS Configs– Crons– Versions
• Browsers• Java• Etc..
![Page 17: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/17.jpg)
Speed
• Smaller Nodes– Better to have 10 computers with 1 browser
• It’s ok to use low end machines
![Page 18: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/18.jpg)
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
![Page 19: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/19.jpg)
Coverage
• Can we add IE6 and 7 to the Grid?
![Page 20: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/20.jpg)
Coverage
![Page 21: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/21.jpg)
Coverage
• More maintenance• IE8 takes 50% of free time
• IE9 or > is much Safer to use
![Page 22: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/22.jpg)
International Buy Jim Evans a BEER day!
![Page 23: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/23.jpg)
International Buy Jim Evans a BEER day!
![Page 24: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/24.jpg)
![Page 25: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/25.jpg)
International Buy Jim Evans a BEER day!
![Page 26: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/26.jpg)
![Page 27: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/27.jpg)
More On Stability
• Don’t Use RC– java -jar selenium.jar -role node
![Page 28: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/28.jpg)
More On Stability
• Don’t Use RC• Use WebDriver–java -jar selenium.jar -role wd
![Page 29: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/29.jpg)
More On Stability
• Replace Internet Explorer with Batch file• Create Crons (Scheduled Tasks)– Periodically Restart Grid node (JAR)– Periodically Restart Computer
![Page 30: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/30.jpg)
More On Stability
• Replace Internet Explorer with Batch file– Cleans up Cookies, Cache, etc– Launches Internet Explorere
![Page 31: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/31.jpg)
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
![Page 32: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/32.jpg)
More On Stability
• Replace Internet Explorer with Batch file• Create Crons (Scheduled Tasks)• Auto login & Auto Start at login• Etc.. Etc.. Etc..
![Page 33: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/33.jpg)
Selenium Grid Extras
• 1 year old
![Page 34: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/34.jpg)
Selenium Grid Extras
• https://github.com/groupon/Selenium-Grid-Extras
![Page 35: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/35.jpg)
Goal of the Project
• Document Grid Stability with code
![Page 36: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/36.jpg)
Goal of the Project
• Document Grid Stability with code– (Poorly written Java code that is)
• Make the setup and maintenance of the grid simple
![Page 37: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/37.jpg)
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
![Page 38: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/38.jpg)
Latest Features
• Restart node every X builds, when node is free• Jenkins Plugin• Video recording of test (Work in progress)
![Page 39: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/39.jpg)
Optionally Reboot OS
• Windows reboot not optional!• Improves speed and test stability• Prevents this:
![Page 40: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/40.jpg)
![Page 41: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/41.jpg)
Video Recording
• (Work in Progress)
![Page 42: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/42.jpg)
Demo
![Page 43: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/43.jpg)
Jenkins Plugin
• (Work in Progress)
![Page 44: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/44.jpg)
![Page 45: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/45.jpg)
Find IE Crashes at a Glance
![Page 46: Scaling and Managing Selenium Grid](https://reader035.vdocuments.us/reader035/viewer/2022081413/547c2853b4af9f21708b45f0/html5/thumbnails/46.jpg)
Questions?