SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Selenium Grid Workshop
Schedule
9:00-9:30 — General Set up: Power Cords, Wi-Fi, Seating, and Introductions
9:30-10:30 — Grid Overview, Basic Concepts & Philosophy
10:30-10:45 — Break
10:45-12:00 — Hub/Node Setup and Config
12:00-1:00 — Lunch
1:30-3:30 — Docker, Troubleshooting, and Advanced Options
3:30-3:45 — Break
3:45-5:00 — Extensions, Plug-ins, Auto-scaling, and Advanced Logging
— Q&A, Anecdotes, Discussion, and General Tips & Tricks
Overview
● Terminology
● General Flow
● Hub/Node Details
● Configuration
● Docker Intro
● Edge (if you dare)
● Preview of Next Session
https://goo.gl/BWlK1a
Terminology
● Hub
● Node
● Test Slot
● Test
● Thread
● Proxy
Grid 101
Hub
● The intermediary and manager
● Accepts requests to run tests
● Allocates Test Slots to nodes
● Takes instructions directly from client, and executes them
remotely on nodes
● The Hub only manages threads—it performs zero browser
work
Node
- Registers itself to Hub listed in config
- Communicates its config to the Hub at registration time:
- Test Slots per browser
- “Hey Hub, I have 1 Slot for Firefox, 5 for Chrome”
- Receives json wire protocol instructions from the Hub
- Executes instructions, keeping threads separated
- The Node does not evaluate, make judgments, or control
anything: it only receives and executes instructions (and
throws exceptions)
Start the Hub:
java -jar selenium-server-standalone-3.0.1.jar -role hub
Register a node:
java -jar selenium-server-standalone-3.0.1.jar -role node
-hub http://localhost:4444/grid/register -browser
browserName=firefox,maxInstances=3 -browser
browserName=chrome,maxInstances=5
*All commands are case sensitive!
Starting From Command-line
Hub Parameters — Configuration
● -port
Default is 4444, use this to override
● -jettyMaxThreads <int>
Maximum number of threads server will pool
● -cleanUpCycle <milliseconds>
Interval for hub to poll for inactive test sessions
Hub Parameters - Timeouts
● -timeout <seconds>
● -browserTimeout <seconds, min 60>
Timeout between receiving individual commands
60 seconds minimum value
● -newSessionWaitTimeout <milliseconds>
Timeout the server will wait for a new Session to be created
Hub Parameters —
● -prioritizer
Class (on the classpath!) that will be used to sort queued new Session requests
Must implement Prioritizer
● -servlets
Custom servlets, mainly for grid plugins
● -log <filename>
Hub Parameters — Capabilities
● -throwOnCapabilityNotPresent
● -capabilityMatcher
Class that implements CapabilityMatcher
DefaultCapabilityMatcher only checks Platform, Browser Name, Version,
“applicationName”
Node Command line options
● -nodeConfig <filename>
● -hubHost <DNS entry>
● -hubPort <port>
● -host <localhost>
● -port <local port>
● -maxSession <int>
● -register
● -servlets
Node Parameters — JSON file
● -nodeConfig <filename>
{ "capabilities": [
{ "browserName": "chrome",
"maxInstances": 5,
"platform": "WINDOWS",
"webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" }, ],
"configuration": {
"_comment" : "Configuration for Node",
"cleanUpCycle": 2000,
"proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy",
"port": 5555,
"host": ip,
"register": true,
"hubPort": 4444,
"maxSessions": 5 }
}
Node Command line options
● -browser param1=val1,param2=val2
Usually, only browserName, platform, version, applicationName and
maxInstances are important
● -cleanUpCycle <milliseconds>
● -registerCycle <milliseconds>
How often the node will try to register itself again. Allows you to restart the hub
without having to restart the nodes
Run It!
● We’ll write a quick javascript test
● Use node to run it
● We’ll need:
○ Node (v6.9.0) (brew install node)
○ selenium-webdriver module (npm install -g selenium-webdriver)
○ chromedriver v2.25.426935
● Paste script (https://goo.gl/sRNVVC) into test.js
● node test.js
● It will go really fast, so be sure to watch!
docker 101
● docker ps
● docker exec -it <container id> bash
● docker kill <image>
● docker run
● docker images -a
● docker rmi <image>
● docker -p
● docker -P
● docker -d
● docker --link
docker-selenium Standalone
Running a standalone machine without connecting to a hub
● selenium/standalone-chrome: Selenium standalone with Chrome installed
● selenium/standalone-firefox: Selenium standalone with Firefox installed
● selenium/standalone-chrome-debug: Selenium standalone with Chrome
installed and runs a VNC server
● selenium/standalone-firefox-debug: Selenium standalone with Firefox installed
and runs a VNC server
docker-selenium Standalone
Start docker instance:
Chrome docker run -d -p 4455:4444 selenium/standalone-chrome:2.53.0
Firefox docker run -d -p 4466:4444 selenium/standalone-firefox:2.53.0
docker run -d --name se -p 5900:5900 -p 4444:4444
selenium/standalone-chrome-debug
Check they are up and running and you can connect to them!
http://localhost:4455/wd/hub/status
http://localhost:4466/wd/hub/status
Register them to your running hub: https://goo.gl/TE4xuv
docker-selenium GRID
● selenium/hub: Image for running a Selenium Grid Hub
● selenium/node-chrome: Selenium node with Chrome installed, needs to
be connected to a Selenium Grid Hub
● selenium/node-firefox: Selenium node with Firefox installed, needs to be
connected to a Selenium Grid Hub
● selenium/node-chrome-debug: Selenium node with Chrome installed
and runs a VNC server, needs to be connected to a Selenium Grid Hub
● selenium/node-firefox-debug: Selenium node with Firefox installed and
runs a VNC server, needs to be connected to a Selenium Grid Hub
docker-selenium GRID
● Creating a docker HUB instance
docker run -d -p 5000:4444 --name selenium-hub -P selenium/hub
To check if the hub is up and running
http://localhost:5000/grid/console
● Run a Chrome Node and Link it to Hub
docker run -d --link selenium-hub:hub -P --name chrome
selenium/node-chrome-debug
● Run a Firefox Node and Link it to Hub
docker run -d --link selenium-hub:hub -P --name firefox
selenium/node-firefox-debug
Selenium GRID with docker-compose
docker-compose is a YAML file that will help manage your docker services
● Start, stop & rebuild services
● View the status and logs of services.
To get a docker-compose yml file: https://goo.gl/puYvnV
To spin up Selenium Grid: docker-compose up -d
Q&A
Thank You All!
Marcus Merrell
&
Manoj Kumar
Add a Windows VM https://goo.gl/P8q7jT
starting Edge node
java -jar
selenium-standalone-server-3.0.1.jar
-nodeConfig config.json -port 4444 -hub
http://<host>:<port>/grid/register -host <ip
address of win10 vm> -role node
config file:
https://goo.gl/LWdsGm
Other Grid Topics
Selenium Grid Extras
https://github.com/groupon/Selenium-Grid-Extras
Selenium Grid Scaler
https://github.com/mhardin/SeleniumGridScaler
BrowserMob Proxy
https://bmp.lightbody.net/
Run Via Saucelabs
java 
> -cp 
> selenium-server-standalone-3.0.1.jar; 
> sauce-grid-plugin-1.0.4.jar 
> org.openqa.grid.selenium.GridLauncher 
> -role hub 
> -servlets 
> com.saucelabs.grid.SauceOnDemandAdminServlet, 
> com.saucelabs.grid.SauceOnDemandConsoleServlet

Contenu connexe

Tendances

The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testing
Duy Tan Geek
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
liqiang xu
 
Scripting Yor Java Application with BSF3
Scripting Yor Java Application with BSF3Scripting Yor Java Application with BSF3
Scripting Yor Java Application with BSF3
day
 

Tendances (20)

[Perforce] Adventures in Build
[Perforce] Adventures in Build[Perforce] Adventures in Build
[Perforce] Adventures in Build
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testing
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
CommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package ManagerCommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package Manager
 
runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...
 
Configuration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needsConfiguration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needs
 
Delivering a production Cloud Foundry Environment with Bosh | anynines
Delivering a production Cloud Foundry Environment with Bosh | anyninesDelivering a production Cloud Foundry Environment with Bosh | anynines
Delivering a production Cloud Foundry Environment with Bosh | anynines
 
Nginx Essential
Nginx EssentialNginx Essential
Nginx Essential
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Cloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anyninesCloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anynines
 
JBoss AS 7 따라잡기
JBoss AS 7 따라잡기JBoss AS 7 따라잡기
JBoss AS 7 따라잡기
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
 
Scripting Yor Java Application with BSF3
Scripting Yor Java Application with BSF3Scripting Yor Java Application with BSF3
Scripting Yor Java Application with BSF3
 
Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...
 

En vedette

CodeFest 2014. Макаров Н. — Selenium Grid. OK Version
CodeFest 2014. Макаров Н. — Selenium Grid. OK VersionCodeFest 2014. Макаров Н. — Selenium Grid. OK Version
CodeFest 2014. Макаров Н. — Selenium Grid. OK Version
CodeFest
 

En vedette (20)

Automation Using Selenium Webdriver
Automation Using Selenium WebdriverAutomation Using Selenium Webdriver
Automation Using Selenium Webdriver
 
Continuous Delivery With Selenium Grid And Docker
Continuous Delivery With Selenium Grid And DockerContinuous Delivery With Selenium Grid And Docker
Continuous Delivery With Selenium Grid And Docker
 
Distributed automation sel_conf_2015
Distributed automation sel_conf_2015Distributed automation sel_conf_2015
Distributed automation sel_conf_2015
 
Selenium-Grid-Extras
Selenium-Grid-ExtrasSelenium-Grid-Extras
Selenium-Grid-Extras
 
KraQA #22, Filip Cynarski - Selenium Grid w chmurze Amazon Web Services
KraQA #22, Filip Cynarski -  Selenium Grid w chmurze Amazon Web ServicesKraQA #22, Filip Cynarski -  Selenium Grid w chmurze Amazon Web Services
KraQA #22, Filip Cynarski - Selenium Grid w chmurze Amazon Web Services
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
Grading the Quality of Selenium Tests
Grading the Quality of Selenium TestsGrading the Quality of Selenium Tests
Grading the Quality of Selenium Tests
 
User Analytics Testing - SeleniumCamp 2015
User Analytics Testing - SeleniumCamp 2015User Analytics Testing - SeleniumCamp 2015
User Analytics Testing - SeleniumCamp 2015
 
Selenium lightning-talk
Selenium lightning-talkSelenium lightning-talk
Selenium lightning-talk
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium Workshop
 
SeleniumCamp 2015 Andrii Soldatenko
SeleniumCamp 2015 Andrii SoldatenkoSeleniumCamp 2015 Andrii Soldatenko
SeleniumCamp 2015 Andrii Soldatenko
 
CodeFest 2014. Макаров Н. — Selenium Grid. OK Version
CodeFest 2014. Макаров Н. — Selenium Grid. OK VersionCodeFest 2014. Макаров Н. — Selenium Grid. OK Version
CodeFest 2014. Макаров Н. — Selenium Grid. OK Version
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 
Automation test
Automation testAutomation test
Automation test
 
Docker AWS TechCONNECT Boston, 28-July-2015
Docker AWS TechCONNECT Boston, 28-July-2015Docker AWS TechCONNECT Boston, 28-July-2015
Docker AWS TechCONNECT Boston, 28-July-2015
 
Selenium Gridで遊ぼう
Selenium Gridで遊ぼうSelenium Gridで遊ぼう
Selenium Gridで遊ぼう
 
Distributed automation selcamp2016
Distributed automation selcamp2016Distributed automation selcamp2016
Distributed automation selcamp2016
 
Fast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-gridFast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-grid
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep Dive
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
 

Similaire à Selenium grid workshop london 2016

Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
Nick Belhomme
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
nickblah
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
Akshaya Mahapatra
 

Similaire à Selenium grid workshop london 2016 (20)

Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get DiagnosticsBoris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
ДМИТРО БУДИМ «Mobile Automation Infrastructure from scratch» Online QADay 202...
ДМИТРО БУДИМ «Mobile Automation Infrastructure from scratch» Online QADay 202...ДМИТРО БУДИМ «Mobile Automation Infrastructure from scratch» Online QADay 202...
ДМИТРО БУДИМ «Mobile Automation Infrastructure from scratch» Online QADay 202...
 
Automation day red hat ansible
   Automation day red hat ansible    Automation day red hat ansible
Automation day red hat ansible
 
Telemetry indepth
Telemetry indepthTelemetry indepth
Telemetry indepth
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
 
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical NagiosNagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven Infrastructure
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Switch as a Server - PuppetConf 2014 - Leslie Carr
Switch as a Server - PuppetConf 2014 - Leslie CarrSwitch as a Server - PuppetConf 2014 - Leslie Carr
Switch as a Server - PuppetConf 2014 - Leslie Carr
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 

Dernier

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Dernier (20)

NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Selenium grid workshop london 2016

  • 2. Schedule 9:00-9:30 — General Set up: Power Cords, Wi-Fi, Seating, and Introductions 9:30-10:30 — Grid Overview, Basic Concepts & Philosophy 10:30-10:45 — Break 10:45-12:00 — Hub/Node Setup and Config 12:00-1:00 — Lunch 1:30-3:30 — Docker, Troubleshooting, and Advanced Options 3:30-3:45 — Break 3:45-5:00 — Extensions, Plug-ins, Auto-scaling, and Advanced Logging — Q&A, Anecdotes, Discussion, and General Tips & Tricks
  • 3. Overview ● Terminology ● General Flow ● Hub/Node Details ● Configuration ● Docker Intro ● Edge (if you dare) ● Preview of Next Session https://goo.gl/BWlK1a
  • 4. Terminology ● Hub ● Node ● Test Slot ● Test ● Thread ● Proxy
  • 6. Hub ● The intermediary and manager ● Accepts requests to run tests ● Allocates Test Slots to nodes ● Takes instructions directly from client, and executes them remotely on nodes ● The Hub only manages threads—it performs zero browser work
  • 7. Node - Registers itself to Hub listed in config - Communicates its config to the Hub at registration time: - Test Slots per browser - “Hey Hub, I have 1 Slot for Firefox, 5 for Chrome” - Receives json wire protocol instructions from the Hub - Executes instructions, keeping threads separated - The Node does not evaluate, make judgments, or control anything: it only receives and executes instructions (and throws exceptions)
  • 8. Start the Hub: java -jar selenium-server-standalone-3.0.1.jar -role hub Register a node: java -jar selenium-server-standalone-3.0.1.jar -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=3 -browser browserName=chrome,maxInstances=5 *All commands are case sensitive! Starting From Command-line
  • 9. Hub Parameters — Configuration ● -port Default is 4444, use this to override ● -jettyMaxThreads <int> Maximum number of threads server will pool ● -cleanUpCycle <milliseconds> Interval for hub to poll for inactive test sessions
  • 10. Hub Parameters - Timeouts ● -timeout <seconds> ● -browserTimeout <seconds, min 60> Timeout between receiving individual commands 60 seconds minimum value ● -newSessionWaitTimeout <milliseconds> Timeout the server will wait for a new Session to be created
  • 11. Hub Parameters — ● -prioritizer Class (on the classpath!) that will be used to sort queued new Session requests Must implement Prioritizer ● -servlets Custom servlets, mainly for grid plugins ● -log <filename>
  • 12. Hub Parameters — Capabilities ● -throwOnCapabilityNotPresent ● -capabilityMatcher Class that implements CapabilityMatcher DefaultCapabilityMatcher only checks Platform, Browser Name, Version, “applicationName”
  • 13. Node Command line options ● -nodeConfig <filename> ● -hubHost <DNS entry> ● -hubPort <port> ● -host <localhost> ● -port <local port> ● -maxSession <int> ● -register ● -servlets
  • 14. Node Parameters — JSON file ● -nodeConfig <filename> { "capabilities": [ { "browserName": "chrome", "maxInstances": 5, "platform": "WINDOWS", "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" }, ], "configuration": { "_comment" : "Configuration for Node", "cleanUpCycle": 2000, "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", "port": 5555, "host": ip, "register": true, "hubPort": 4444, "maxSessions": 5 } }
  • 15. Node Command line options ● -browser param1=val1,param2=val2 Usually, only browserName, platform, version, applicationName and maxInstances are important ● -cleanUpCycle <milliseconds> ● -registerCycle <milliseconds> How often the node will try to register itself again. Allows you to restart the hub without having to restart the nodes
  • 16. Run It! ● We’ll write a quick javascript test ● Use node to run it ● We’ll need: ○ Node (v6.9.0) (brew install node) ○ selenium-webdriver module (npm install -g selenium-webdriver) ○ chromedriver v2.25.426935 ● Paste script (https://goo.gl/sRNVVC) into test.js ● node test.js ● It will go really fast, so be sure to watch!
  • 17. docker 101 ● docker ps ● docker exec -it <container id> bash ● docker kill <image> ● docker run ● docker images -a ● docker rmi <image> ● docker -p ● docker -P ● docker -d ● docker --link
  • 18. docker-selenium Standalone Running a standalone machine without connecting to a hub ● selenium/standalone-chrome: Selenium standalone with Chrome installed ● selenium/standalone-firefox: Selenium standalone with Firefox installed ● selenium/standalone-chrome-debug: Selenium standalone with Chrome installed and runs a VNC server ● selenium/standalone-firefox-debug: Selenium standalone with Firefox installed and runs a VNC server
  • 19. docker-selenium Standalone Start docker instance: Chrome docker run -d -p 4455:4444 selenium/standalone-chrome:2.53.0 Firefox docker run -d -p 4466:4444 selenium/standalone-firefox:2.53.0 docker run -d --name se -p 5900:5900 -p 4444:4444 selenium/standalone-chrome-debug Check they are up and running and you can connect to them! http://localhost:4455/wd/hub/status http://localhost:4466/wd/hub/status Register them to your running hub: https://goo.gl/TE4xuv
  • 20. docker-selenium GRID ● selenium/hub: Image for running a Selenium Grid Hub ● selenium/node-chrome: Selenium node with Chrome installed, needs to be connected to a Selenium Grid Hub ● selenium/node-firefox: Selenium node with Firefox installed, needs to be connected to a Selenium Grid Hub ● selenium/node-chrome-debug: Selenium node with Chrome installed and runs a VNC server, needs to be connected to a Selenium Grid Hub ● selenium/node-firefox-debug: Selenium node with Firefox installed and runs a VNC server, needs to be connected to a Selenium Grid Hub
  • 21. docker-selenium GRID ● Creating a docker HUB instance docker run -d -p 5000:4444 --name selenium-hub -P selenium/hub To check if the hub is up and running http://localhost:5000/grid/console ● Run a Chrome Node and Link it to Hub docker run -d --link selenium-hub:hub -P --name chrome selenium/node-chrome-debug ● Run a Firefox Node and Link it to Hub docker run -d --link selenium-hub:hub -P --name firefox selenium/node-firefox-debug
  • 22. Selenium GRID with docker-compose docker-compose is a YAML file that will help manage your docker services ● Start, stop & rebuild services ● View the status and logs of services. To get a docker-compose yml file: https://goo.gl/puYvnV To spin up Selenium Grid: docker-compose up -d
  • 23. Q&A Thank You All! Marcus Merrell & Manoj Kumar
  • 24. Add a Windows VM https://goo.gl/P8q7jT
  • 25. starting Edge node java -jar selenium-standalone-server-3.0.1.jar -nodeConfig config.json -port 4444 -hub http://<host>:<port>/grid/register -host <ip address of win10 vm> -role node config file: https://goo.gl/LWdsGm
  • 26. Other Grid Topics Selenium Grid Extras https://github.com/groupon/Selenium-Grid-Extras Selenium Grid Scaler https://github.com/mhardin/SeleniumGridScaler BrowserMob Proxy https://bmp.lightbody.net/
  • 27. Run Via Saucelabs java > -cp > selenium-server-standalone-3.0.1.jar; > sauce-grid-plugin-1.0.4.jar > org.openqa.grid.selenium.GridLauncher > -role hub > -servlets > com.saucelabs.grid.SauceOnDemandAdminServlet, > com.saucelabs.grid.SauceOnDemandConsoleServlet