SlideShare une entreprise Scribd logo
1  sur  24
Selenium Grid
       Kevin Menard
 Maintainer, Selenium Grid
    Founder, Mogotest
What is Selenium Grid?



• Maintain a cluster of Selenium RC servers
• Configure tests for different environments
• Parallelize your tests
How Does it Work?

Selenium Grid Hub      Selenium Grid Node   Selenium RC Server



                       Selenium Grid Node   Selenium RC Server

                       host_a


     Client
      Client           Selenium Grid Node   Selenium RC Server
       Client
        Client

                       host_b
How Does it Work?

Selenium Grid Hub      Selenium Grid Node   Selenium RC Server



                       Selenium Grid Node   Selenium RC Server

                       host_a


     Client
      Client           Selenium Grid Node   Selenium RC Server
       Client
        Client

                       host_b
How Does it Work?

Selenium Grid Hub      Selenium Grid Node   Selenium RC Server



                       Selenium Grid Node   Selenium RC Server

                       host_a


     Client
      Client           Selenium Grid Node   Selenium RC Server
       Client
        Client

                       host_b
Environments

    • Map descriptive names to browser strings
    • Configured in Selenium Grid Hub

hub:
  environments:
     - name:    "linux_firefox_3_6"
       browser: "*firefox /opt/firefox-3.6/firefox-bin"
     - name:    "windows_firefox_3_5"
       browser: "*firefox"
     - name:    "windows_firefox_3_6"
       browser: "*firefox"
Starting the Hub

   • Edit grid_configuration.yml

Rake:
 $ rake hub:start
 $ BACKGROUND=true nohup rake hub:start &>/dev/null



ant:
 $ ant launch-hub
 $ nohup ant launch-hub >> log_file 2>&1
Selenium Grid Console
• Open http://localhost:4444/console
Starting Up a Node
Rake:
 $ rake rc:start
 $ DISPLAY=:99.0 BACKGROUND=true HOST=host_b PORT=5000
 ENVIRONMENT=linux_firefox_3_6 HUB_URL='http://hub_host:4444'
 SELENIUM_ARGS='-ensureCleanSession -noBrowserSessionReuse'
 nohup rake rc:start &>/dev/null



ant:
 $ ant launch-remote-control
 $ DISPLAY=:99.0 nohup ant -Dhost=host_b -Dport=5000
 -Denvironment=linux_firefox_3_6 -DhubURL='http://hub_host:4444'
 -DseleniumArgs='-ensureCleanSession -noBrowserSessionReuse'
 launch-remote-control >> log_file 2>&1
Node Registration
                     1. Node connects to hub
Selenium Grid Node                                        Selenium Grid Hub
                       environment   windows_firefox_3_6
                          host             host_b
                          port             5000
Node Registration
                     1. Node connects to hub
Selenium Grid Node                                            Selenium Grid Hub
                        environment   windows_firefox_3_6
                           host             host_b
                           port             5000




        2. Hub adds node to environment queue
      windows_chrome                                 windows_firefox_3_6
          host_c:5000                                      host_a:5000

      linux_firefox_3_6                                     host_a:5001

          host_d:5000                                      host_b:5000
Available Node in
     Console
Client Connection

• Client connects with environment name as
  browser string
• Hub looks up by environment & reserves a
  node
  • Blocks until one is available
• Client communicates with hub at all times
  • Hub forwards traffic to correct node
Client Connection Code

Old:                                    New:

require 'rubygems'                      require 'rubygems'
require 'selenium/client'               require 'selenium/client'

browser =                               browser =
  Selenium::Client::Driver.new           Selenium::Client::Driver.new 
    :host => 'localhost',                   :host => 'localhost',
    :port => 4444,                          :port => 4444,
    :browser => '*firefox',                 :browser => 'linux_firefox_3_6',
    :url => 'http://mogotest.com/'          :url => 'http://mogotest.com/'

browser.start_new_browser_session       browser.start_new_browser_session
browser.open 'http://mogotest.com/'     browser.open 'http://mogotest.com/'
browser.close_current_browser_session   browser.close_current_browser_session
Makes Testing Simpler


• Client always connects to known
  endpoint
• Hub takes care of browser allocation
• Nodes can be added dynamically
• Hub handles bad nodes
Grid Resiliency


• Hub can send heartbeat requests to node to
  tell if it has gone down
• Hub can gracefully kill idle sessions
• Hub can kill sessions that take too long to
  create
Parallel Testing

• Need a way to execute in parallel
  • Java: TestNG or parallel-jUnit
  • Ruby: DeepTest
  • Python: nose
• Need a way to parameterize your tests for
  each node’s environment
• Your tests must maintain their own state
Shortcomings

• Selenium 1 API compatible only
  • Using an old version of Selenium RC at that
• 1 request per RC
  • Doesn’t scale vertically very well
• Historically has had multi-threaded problems
  • Fixed as of 1.0.8
Selenium Grid’s Future


• Combine Selenium Grid & RC
  • De facto single-node grid
  • Grid available out of the box
• Auto-discovery of other nodes on network
Selenium Grid 2.0

• Proposal on dev list for new grid 2.0
• Project rewrite by François Reynaud
• Supports Selenium 1 & 2 APIs
• Nicer Web interface
• Very extensible with callback points &
  listeners
Selenium Grid 2.0
        Listeners


• Possible uses
 • Priority queue for test execution
 • Stat tracking
 • OS environment preparation
Conclusion

• Selenium Grid is alive and well
 • 4 releases in the last 9 months
• Pushing towards a Selenium 2
  compatible grid
• If you have time, please review the
  proposed new grid code
Resources
Resources

• Project:
  • Source: http://github.com/nirvdrum/selenium-grid
  • Issues: http://selenium.googlecode.com/
  • Blog: http://seleniumhq.wordpress.com/

• Personal:
  • Twitter: @nirvdrum
  • Email: kevin@mogotest.com

Contenu connexe

Tendances

Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Simplilearn
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and SeleniumKarapet Sarkisyan
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesVijay Rangaiah
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planningSivaprasanthRentala1975
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Edureka!
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriverRajathi-QA
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
 
Performance Testing
Performance TestingPerformance Testing
Performance Testingsharmaparish
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionAmr E. Mohamed
 
Introduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewIntroduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewDisha Srivastava
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverPankaj Biswas
 

Tendances (20)

SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
 
Selenium
SeleniumSelenium
Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Selenium
SeleniumSelenium
Selenium
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Introduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewIntroduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiew
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 

Similaire à Selenium Grid

Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshopseleniumconf
 
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...Sargis Sargsyan
 
Automatically test in WebEx11
Automatically test in WebEx11Automatically test in WebEx11
Automatically test in WebEx11showgoodjiang
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisTiago Simões
 
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Sargis Sargsyan
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)Allan Naim
 
Grid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium gridGrid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium gridMikhail Levin
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshoploodse
 
OSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical UpdateOSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical Updatemfrancis
 
Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2Sebastiano Armeli
 
Scalable Selenium cluster: up and running
Scalable Selenium cluster: up and runningScalable Selenium cluster: up and running
Scalable Selenium cluster: up and runningIvan Krutov
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerSargis Sargsyan
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolutionWise Engineering
 
Using MCollective with Chef - cfgmgmtcamp.eu 2014
Using MCollective with Chef - cfgmgmtcamp.eu 2014Using MCollective with Chef - cfgmgmtcamp.eu 2014
Using MCollective with Chef - cfgmgmtcamp.eu 2014Zachary Stevens
 
How to configure a hive high availability connection with zeppelin
How to configure a hive high availability connection with zeppelinHow to configure a hive high availability connection with zeppelin
How to configure a hive high availability connection with zeppelinTiago Simões
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionSachin-QA
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionANKUR-BA
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016Marcus Merrell
 

Similaire à Selenium Grid (20)

Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshop
 
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
 
Automatically test in WebEx11
Automatically test in WebEx11Automatically test in WebEx11
Automatically test in WebEx11
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
 
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
 
Grid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium gridGrid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium grid
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
 
OSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical UpdateOSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical Update
 
Selenium
SeleniumSelenium
Selenium
 
Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2
 
Scalable Selenium cluster: up and running
Scalable Selenium cluster: up and runningScalable Selenium cluster: up and running
Scalable Selenium cluster: up and running
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium Docker
 
Selenium
SeleniumSelenium
Selenium
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
Using MCollective with Chef - cfgmgmtcamp.eu 2014
Using MCollective with Chef - cfgmgmtcamp.eu 2014Using MCollective with Chef - cfgmgmtcamp.eu 2014
Using MCollective with Chef - cfgmgmtcamp.eu 2014
 
How to configure a hive high availability connection with zeppelin
How to configure a hive high availability connection with zeppelinHow to configure a hive high availability connection with zeppelin
How to configure a hive high availability connection with zeppelin
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Selenium Grid

  • 1. Selenium Grid Kevin Menard Maintainer, Selenium Grid Founder, Mogotest
  • 2. What is Selenium Grid? • Maintain a cluster of Selenium RC servers • Configure tests for different environments • Parallelize your tests
  • 3. How Does it Work? Selenium Grid Hub Selenium Grid Node Selenium RC Server Selenium Grid Node Selenium RC Server host_a Client Client Selenium Grid Node Selenium RC Server Client Client host_b
  • 4. How Does it Work? Selenium Grid Hub Selenium Grid Node Selenium RC Server Selenium Grid Node Selenium RC Server host_a Client Client Selenium Grid Node Selenium RC Server Client Client host_b
  • 5. How Does it Work? Selenium Grid Hub Selenium Grid Node Selenium RC Server Selenium Grid Node Selenium RC Server host_a Client Client Selenium Grid Node Selenium RC Server Client Client host_b
  • 6. Environments • Map descriptive names to browser strings • Configured in Selenium Grid Hub hub: environments: - name: "linux_firefox_3_6" browser: "*firefox /opt/firefox-3.6/firefox-bin" - name: "windows_firefox_3_5" browser: "*firefox" - name: "windows_firefox_3_6" browser: "*firefox"
  • 7. Starting the Hub • Edit grid_configuration.yml Rake: $ rake hub:start $ BACKGROUND=true nohup rake hub:start &>/dev/null ant: $ ant launch-hub $ nohup ant launch-hub >> log_file 2>&1
  • 8. Selenium Grid Console • Open http://localhost:4444/console
  • 9. Starting Up a Node Rake: $ rake rc:start $ DISPLAY=:99.0 BACKGROUND=true HOST=host_b PORT=5000 ENVIRONMENT=linux_firefox_3_6 HUB_URL='http://hub_host:4444' SELENIUM_ARGS='-ensureCleanSession -noBrowserSessionReuse' nohup rake rc:start &>/dev/null ant: $ ant launch-remote-control $ DISPLAY=:99.0 nohup ant -Dhost=host_b -Dport=5000 -Denvironment=linux_firefox_3_6 -DhubURL='http://hub_host:4444' -DseleniumArgs='-ensureCleanSession -noBrowserSessionReuse' launch-remote-control >> log_file 2>&1
  • 10. Node Registration 1. Node connects to hub Selenium Grid Node Selenium Grid Hub environment windows_firefox_3_6 host host_b port 5000
  • 11. Node Registration 1. Node connects to hub Selenium Grid Node Selenium Grid Hub environment windows_firefox_3_6 host host_b port 5000 2. Hub adds node to environment queue windows_chrome windows_firefox_3_6 host_c:5000 host_a:5000 linux_firefox_3_6 host_a:5001 host_d:5000 host_b:5000
  • 12. Available Node in Console
  • 13. Client Connection • Client connects with environment name as browser string • Hub looks up by environment & reserves a node • Blocks until one is available • Client communicates with hub at all times • Hub forwards traffic to correct node
  • 14. Client Connection Code Old: New: require 'rubygems' require 'rubygems' require 'selenium/client' require 'selenium/client' browser = browser = Selenium::Client::Driver.new Selenium::Client::Driver.new :host => 'localhost', :host => 'localhost', :port => 4444, :port => 4444, :browser => '*firefox', :browser => 'linux_firefox_3_6', :url => 'http://mogotest.com/' :url => 'http://mogotest.com/' browser.start_new_browser_session browser.start_new_browser_session browser.open 'http://mogotest.com/' browser.open 'http://mogotest.com/' browser.close_current_browser_session browser.close_current_browser_session
  • 15. Makes Testing Simpler • Client always connects to known endpoint • Hub takes care of browser allocation • Nodes can be added dynamically • Hub handles bad nodes
  • 16. Grid Resiliency • Hub can send heartbeat requests to node to tell if it has gone down • Hub can gracefully kill idle sessions • Hub can kill sessions that take too long to create
  • 17. Parallel Testing • Need a way to execute in parallel • Java: TestNG or parallel-jUnit • Ruby: DeepTest • Python: nose • Need a way to parameterize your tests for each node’s environment • Your tests must maintain their own state
  • 18. Shortcomings • Selenium 1 API compatible only • Using an old version of Selenium RC at that • 1 request per RC • Doesn’t scale vertically very well • Historically has had multi-threaded problems • Fixed as of 1.0.8
  • 19. Selenium Grid’s Future • Combine Selenium Grid & RC • De facto single-node grid • Grid available out of the box • Auto-discovery of other nodes on network
  • 20. Selenium Grid 2.0 • Proposal on dev list for new grid 2.0 • Project rewrite by François Reynaud • Supports Selenium 1 & 2 APIs • Nicer Web interface • Very extensible with callback points & listeners
  • 21. Selenium Grid 2.0 Listeners • Possible uses • Priority queue for test execution • Stat tracking • OS environment preparation
  • 22. Conclusion • Selenium Grid is alive and well • 4 releases in the last 9 months • Pushing towards a Selenium 2 compatible grid • If you have time, please review the proposed new grid code
  • 24. Resources • Project: • Source: http://github.com/nirvdrum/selenium-grid • Issues: http://selenium.googlecode.com/ • Blog: http://seleniumhq.wordpress.com/ • Personal: • Twitter: @nirvdrum • Email: kevin@mogotest.com

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. When running headless on *nix you’ll want to set the display value. Xvfb is a great way to do this.\n\nWhen running headless on Windows you’ll want to set up VNC so the window session remains active (RDP won’t work).\n\nThe HOST value must be a routable host from the hub’s point of view. Unless you’re running the hub and the node on the same machine, this value should not be “localhost.”\n\nThe hub URL must not end in a “/”, otherwise the node will fail to register. Yes, this is not a proper URL.\n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. Since Selenium RC Server works over HTTP, you could maintain your own list of known servers and parameterize your tests accordingly, but grid affords additional benefits.\n
  25. \n
  26. Some people are doing this with Hudson.\n\nI’m running tests using resque as an asynchronous job queuing system.\n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n