KEMBAR78
Scaling and Managing Selenium Grid | PPTX
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: 9781783982707 
https://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?

Scaling and Managing Selenium Grid

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