SlideShare ist ein Scribd-Unternehmen logo
1 von 25
WatirGrid
Parallel testing with Watir
About
In 2007, WatirGrid was created by Dane Avilla (brilliant!)

In 2009, I packaged it as a gem , gave it a domain
watirgid.com and have since maintained it …

    Tim Koopmans
    @90kts




               taking the FUD out of performance and test automation...
If Watir is …
WatirGrid is …
WatirGrid
Takes all the advantages of Watir …


                    //todo



And multiplies its use in a distributed,
parallel and coordinated fashion…
In other words “1 test case, many browsers”
WatirGrid is Distributed
Built with standard DRb packages.
Completely written in Ruby using core
libraries.
Lets you control Watir objects remotely with
transmission passed by reference.

 I, [2011-03-24 13:45:06 #1057] INFO -- :
   DRb server started on : druby://192.168.1.6:50600
 I, [2011-03-24 13:45:06 #1057] INFO -- :
   Ring server started on: druby://192.168.1.6:7647
WatirGrid is Parallel
WatirGrid uses Threads to execute Watir test
cases in parallel (sort of). Threads execute on
remote Watir objects, offloading any
processing overheads …

  threads = []
    grid.browsers.each_with_index do |browser, index|
     threads << Thread.new do
       ...
     end
    end
  threads.each {|thread| thread.join}
WatirGrid is Coordinated
    Based on Rinda, the Ruby version of Linda
    …
    Linda is a model of coordination and communication
    among several parallel processes operating upon objects
    stored in and retrieved from shared, virtual, associative
    memory. [1]


[1] Markoff, John (January 19, 1992). "David Gelernter's Romance With Linda". The New York Times.
WatirGrid is Free
   Uses the BSD license[1]


[1] https://github.com/90kts/watirgrid/raw/master/LICENSE
Key Terminology
Controllers implements a repository of tuples (tuple
space) that can be accessed concurrently. The controller
hosts the ring server which advertises these tuples across
a grid network. Typically you will host one controller on a
central machine.

Providers make remote Watir objects available to the
tuple space hosted by the ring server. Typically you will
host one or many providers on your grid network, for
example, each PC may become a single provider of a
Watir tuple in the form of an Internet Explorer, Firefox or
Safari browser object.
Controller + Providers
= the Grid




A loosely coupled, distributed workforce …
A Canned Example # 1
If you haven‟t already …
  gem install watirgrid


Something simple …
  require 'watirgrid'

  # Start a Controller
  controller = Controller.new
  controller.start

  # Start a Provider with SafariWatir
  provider = Provider.new(:browser_type => 'safari')
  provider.start

  # Create a Grid
  grid = Watir::Grid.new
  grid.start(:take_all => true)
What Just Happened?
Started a Controller
  DRb server was started on a random port
  A Rinda Ring Server was started on port 7647
  INFO -- : DRb server started on : druby://192.168.1.6:51163
  INFO -- : Ring server started on: druby://192.168.1.6:7647

Started 1 Provider (using SafariWatir)
  DRb server started on a random port
  The Ring Server was found on port 7647
  A browser “tuple” was registed on the Ring Server
    INFO -- : DRb server started on : druby://192.168.1.6:51164
    INFO -- : Ring server found on : druby://192.168.1.6:7647
    INFO -- : New tuple registered : druby://192.168.1.6:7647
What Just Happened?
Created a Grid
  We can see the previously registered tuple
  represented as a hash. We‟ll be using the „front
  object‟ provided …
  >> pp grid.browsers.first
  {:uuid=>"235fa1f0-37fd-012e-5bac-78ca394083a0",
   :browser_type=>"safari",
   :class=>:WatirProvider,
   :hostname=>"air.local",
   :object=>#<Watir::Provider:0x10166a240 @browser=Watir::Safari>,
   :name=>:WatirGrid,
   :architecture=>"universal-darwin10.0",
   :description=>"A watir provider"}
Let‟s Use the Grid!
Take the first (and only) browser on the grid
and execute some Watir …
# Take the first browser on the grid and execute some Watir
b = grid.browsers.first[:object].new_browser
b.goto "http://altentee.com"
b.close
A Canned Example # 2
Let‟s try with 2 providers …
  require 'watirgrid'

  # Start a Controller using defaults
  controller = Controller.new
  controller.start

  # Start 2 Providers with WebDriver
  2.times do
   provider = Provider.new(:browser_type => 'webdriver')
   provider.start
  End

  # Start another Grid
  grid = Watir::Grid.new
  grid.start(:take_all => true)
Let‟s Use the Grid!
Take all browsers on the grid in parallel using
Threads …
browser_types = [:firefox, :chrome]

threads = []
 grid.browsers.each_with_index do |browser, index|
   threads << Thread.new do
    b = browser[:object].new_browser(browser_types[index])
    b.goto "http://altentee.com"
    sleep 5
    b.close
   end
 end
threads.each {|thread| thread.join}
Let‟s all Try .. 1
I‟ll start a new Controller on port 12358
  require 'watirgrid'

  # Start a Controller on port 12358
  controller = Controller.new(:ring_server_port => 12358)
  controller.start
Let‟s all Try .. 2
You start a Provider and register on my
Controller
  require 'watirgrid'

  provider = Provider.new(
   browser_type => ‟firefox', # or ie, safari ...
   :ring_server_port => 12358)
  provider.start
Let‟s all Try .. 3!
See if I can control the grid …
  require 'watirgrid'

  # Start another Grid
  grid = Watir::Grid.new
  grid.start(:take_all => true)

  threads = []
    grid.browsers.each do |browser|
     threads << Thread.new do
       b = browser[:object].new_browser
       b.goto("http://www.google.com")
       b.text_field(:name, 'q').set("watirgrid")
       b.button(:name, "btnI").click
       b.close
     end
    end
  threads.each {|thread| thread.join}
Security Considerations
$SAFE = 1
- poor man‟s paranoia
- on latest branch


ACLs
# Start a Controller with Access Control Lists
controller -a deny,all,allow,127.0.0.1 -H 127.0.0.1 -h 127.0.0.1




HTTPS
- not yet implemented
Performance
           Considerations
Yes, but does it scale? 50..n

Ruby threads 1.8 vs. native threads 1.9, truly parallel?

Garbage collection cleaning up referenced objects!

Memory footprint of Controller? 100 Providers = 20MB
What‟$ Next?
GRIDinit.com => a commercial
implementation of WatirGrid on
different cloud providers.

Private alpha April – May,
Public beta June

support@gridinit.com
to participate …
Questions?
  About WatirGrid that is …

Weitere ähnliche Inhalte

Was ist angesagt?

Dockercon Swarm Updated
Dockercon Swarm UpdatedDockercon Swarm Updated
Dockercon Swarm UpdatedDocker, Inc.
 
Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basicsJuraj Hantak
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSRoss Kukulinski
 
distributed tracing in 5 minutes
distributed tracing in 5 minutesdistributed tracing in 5 minutes
distributed tracing in 5 minutesDan Kuebrich
 
How to scale and deploy NodeJS app
How to scale and deploy NodeJS appHow to scale and deploy NodeJS app
How to scale and deploy NodeJS appYacobus Reinhart
 
Puppet - Instant Data Center
Puppet  - Instant Data CenterPuppet  - Instant Data Center
Puppet - Instant Data CenterBryan Belanger
 
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Red Hat Developers
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...Tom Croucher
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Caching Up and Down the Stack
Caching Up and Down the StackCaching Up and Down the Stack
Caching Up and Down the StackDan Kuebrich
 
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean WinnCouch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean WinnTrevor Roberts Jr.
 
The Docker Multitenancy Problem: A Journey through Infrastructure Hell
The Docker Multitenancy Problem: A Journey through Infrastructure HellThe Docker Multitenancy Problem: A Journey through Infrastructure Hell
The Docker Multitenancy Problem: A Journey through Infrastructure HellPeter Klipfel
 
node.js, javascript and the future
node.js, javascript and the futurenode.js, javascript and the future
node.js, javascript and the futureJeff Miccolis
 
C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals DataStax Academy
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Puppet
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Trevor Roberts Jr.
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 

Was ist angesagt? (20)

Dockercon Swarm Updated
Dockercon Swarm UpdatedDockercon Swarm Updated
Dockercon Swarm Updated
 
Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basics
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJS
 
distributed tracing in 5 minutes
distributed tracing in 5 minutesdistributed tracing in 5 minutes
distributed tracing in 5 minutes
 
Docker Insight
Docker InsightDocker Insight
Docker Insight
 
How to scale and deploy NodeJS app
How to scale and deploy NodeJS appHow to scale and deploy NodeJS app
How to scale and deploy NodeJS app
 
Puppet - Instant Data Center
Puppet  - Instant Data CenterPuppet  - Instant Data Center
Puppet - Instant Data Center
 
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
 
Couch to open_stack_keystone
Couch to open_stack_keystoneCouch to open_stack_keystone
Couch to open_stack_keystone
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Caching Up and Down the Stack
Caching Up and Down the StackCaching Up and Down the Stack
Caching Up and Down the Stack
 
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean WinnCouch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
 
Csp and http headers
Csp and http headersCsp and http headers
Csp and http headers
 
The Docker Multitenancy Problem: A Journey through Infrastructure Hell
The Docker Multitenancy Problem: A Journey through Infrastructure HellThe Docker Multitenancy Problem: A Journey through Infrastructure Hell
The Docker Multitenancy Problem: A Journey through Infrastructure Hell
 
node.js, javascript and the future
node.js, javascript and the futurenode.js, javascript and the future
node.js, javascript and the future
 
C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 

Ähnlich wie Parallel testing with WatirGrid

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMNeependra Khare
 
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 Novaclayton_oneill
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Rich Bowen
 
Docker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker, Inc.
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...Guillaume Morini
 
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....Jeffrey Breen
 
Managing multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerManaging multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerThierry Gayet
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopVelocidex Enterprises
 
ДМИТРО БУДИМ «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...GoQA
 
Docker meetup
Docker meetupDocker meetup
Docker meetupsyed1
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksLindsay Holmwood
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesAkihiro Suda
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from DockerTesora
 
Clustering Docker with Docker Swarm on openSUSE
Clustering Docker with Docker Swarm on openSUSEClustering Docker with Docker Swarm on openSUSE
Clustering Docker with Docker Swarm on openSUSESaputro Aryulianto
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Ajeet Singh Raina
 
Docker Security
Docker SecurityDocker Security
Docker Securityantitree
 

Ähnlich wie Parallel testing with WatirGrid (20)

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Swarm mode
Swarm modeSwarm mode
Swarm mode
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBM
 
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
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
Docker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slides
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
 
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....
Big Data Step-by-Step: Infrastructure 3/3: Taking it to the cloud... easily.....
 
Managing multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerManaging multicast/igmp stream on Docker
Managing multicast/igmp stream on Docker
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 
ДМИТРО БУДИМ «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...
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof Networks
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issues
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from Docker
 
Demystfying container-networking
Demystfying container-networkingDemystfying container-networking
Demystfying container-networking
 
Clustering Docker with Docker Swarm on openSUSE
Clustering Docker with Docker Swarm on openSUSEClustering Docker with Docker Swarm on openSUSE
Clustering Docker with Docker Swarm on openSUSE
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
 
Docker Security
Docker SecurityDocker Security
Docker Security
 

Kürzlich hochgeladen

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
[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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
[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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Parallel testing with WatirGrid

  • 2. About In 2007, WatirGrid was created by Dane Avilla (brilliant!) In 2009, I packaged it as a gem , gave it a domain watirgid.com and have since maintained it … Tim Koopmans @90kts taking the FUD out of performance and test automation...
  • 5. WatirGrid Takes all the advantages of Watir … //todo And multiplies its use in a distributed, parallel and coordinated fashion… In other words “1 test case, many browsers”
  • 6. WatirGrid is Distributed Built with standard DRb packages. Completely written in Ruby using core libraries. Lets you control Watir objects remotely with transmission passed by reference. I, [2011-03-24 13:45:06 #1057] INFO -- : DRb server started on : druby://192.168.1.6:50600 I, [2011-03-24 13:45:06 #1057] INFO -- : Ring server started on: druby://192.168.1.6:7647
  • 7. WatirGrid is Parallel WatirGrid uses Threads to execute Watir test cases in parallel (sort of). Threads execute on remote Watir objects, offloading any processing overheads … threads = [] grid.browsers.each_with_index do |browser, index| threads << Thread.new do ... end end threads.each {|thread| thread.join}
  • 8. WatirGrid is Coordinated Based on Rinda, the Ruby version of Linda … Linda is a model of coordination and communication among several parallel processes operating upon objects stored in and retrieved from shared, virtual, associative memory. [1] [1] Markoff, John (January 19, 1992). "David Gelernter's Romance With Linda". The New York Times.
  • 9. WatirGrid is Free Uses the BSD license[1] [1] https://github.com/90kts/watirgrid/raw/master/LICENSE
  • 10. Key Terminology Controllers implements a repository of tuples (tuple space) that can be accessed concurrently. The controller hosts the ring server which advertises these tuples across a grid network. Typically you will host one controller on a central machine. Providers make remote Watir objects available to the tuple space hosted by the ring server. Typically you will host one or many providers on your grid network, for example, each PC may become a single provider of a Watir tuple in the form of an Internet Explorer, Firefox or Safari browser object.
  • 12. = the Grid A loosely coupled, distributed workforce …
  • 13. A Canned Example # 1 If you haven‟t already … gem install watirgrid Something simple … require 'watirgrid' # Start a Controller controller = Controller.new controller.start # Start a Provider with SafariWatir provider = Provider.new(:browser_type => 'safari') provider.start # Create a Grid grid = Watir::Grid.new grid.start(:take_all => true)
  • 14. What Just Happened? Started a Controller DRb server was started on a random port A Rinda Ring Server was started on port 7647 INFO -- : DRb server started on : druby://192.168.1.6:51163 INFO -- : Ring server started on: druby://192.168.1.6:7647 Started 1 Provider (using SafariWatir) DRb server started on a random port The Ring Server was found on port 7647 A browser “tuple” was registed on the Ring Server INFO -- : DRb server started on : druby://192.168.1.6:51164 INFO -- : Ring server found on : druby://192.168.1.6:7647 INFO -- : New tuple registered : druby://192.168.1.6:7647
  • 15. What Just Happened? Created a Grid We can see the previously registered tuple represented as a hash. We‟ll be using the „front object‟ provided … >> pp grid.browsers.first {:uuid=>"235fa1f0-37fd-012e-5bac-78ca394083a0", :browser_type=>"safari", :class=>:WatirProvider, :hostname=>"air.local", :object=>#<Watir::Provider:0x10166a240 @browser=Watir::Safari>, :name=>:WatirGrid, :architecture=>"universal-darwin10.0", :description=>"A watir provider"}
  • 16. Let‟s Use the Grid! Take the first (and only) browser on the grid and execute some Watir … # Take the first browser on the grid and execute some Watir b = grid.browsers.first[:object].new_browser b.goto "http://altentee.com" b.close
  • 17. A Canned Example # 2 Let‟s try with 2 providers … require 'watirgrid' # Start a Controller using defaults controller = Controller.new controller.start # Start 2 Providers with WebDriver 2.times do provider = Provider.new(:browser_type => 'webdriver') provider.start End # Start another Grid grid = Watir::Grid.new grid.start(:take_all => true)
  • 18. Let‟s Use the Grid! Take all browsers on the grid in parallel using Threads … browser_types = [:firefox, :chrome] threads = [] grid.browsers.each_with_index do |browser, index| threads << Thread.new do b = browser[:object].new_browser(browser_types[index]) b.goto "http://altentee.com" sleep 5 b.close end end threads.each {|thread| thread.join}
  • 19. Let‟s all Try .. 1 I‟ll start a new Controller on port 12358 require 'watirgrid' # Start a Controller on port 12358 controller = Controller.new(:ring_server_port => 12358) controller.start
  • 20. Let‟s all Try .. 2 You start a Provider and register on my Controller require 'watirgrid' provider = Provider.new( browser_type => ‟firefox', # or ie, safari ... :ring_server_port => 12358) provider.start
  • 21. Let‟s all Try .. 3! See if I can control the grid … require 'watirgrid' # Start another Grid grid = Watir::Grid.new grid.start(:take_all => true) threads = [] grid.browsers.each do |browser| threads << Thread.new do b = browser[:object].new_browser b.goto("http://www.google.com") b.text_field(:name, 'q').set("watirgrid") b.button(:name, "btnI").click b.close end end threads.each {|thread| thread.join}
  • 22. Security Considerations $SAFE = 1 - poor man‟s paranoia - on latest branch ACLs # Start a Controller with Access Control Lists controller -a deny,all,allow,127.0.0.1 -H 127.0.0.1 -h 127.0.0.1 HTTPS - not yet implemented
  • 23. Performance Considerations Yes, but does it scale? 50..n Ruby threads 1.8 vs. native threads 1.9, truly parallel? Garbage collection cleaning up referenced objects! Memory footprint of Controller? 100 Providers = 20MB
  • 24. What‟$ Next? GRIDinit.com => a commercial implementation of WatirGrid on different cloud providers. Private alpha April – May, Public beta June support@gridinit.com to participate …
  • 25. Questions? About WatirGrid that is …

Hinweis der Redaktion

  1. The standard Ruby library ships with a package known as DRb. You will sometimes see this package referred to as dRuby. No matter what you call the package, they both mean the same thing, Distributed Ruby. DRb is an incredibly easy package to learn and use. It has the benefits of being written completely in Ruby and using core libraries. It also offers advantages such as automatic selection of object transmission (either pass by value or pass by reference), reasonable speed, and the ability to run on any operat- ing system that runs Ruby (see Figure 1-1). DRb also allows you to write applications without a defined interface, which can make for faster development time.
  2. When reviewing all of our DRb applications, you will notice, for a start, that we hardcoded IP addresses and ports into both our servers and clients. This type of tight coupling of applications can be problematic in both production and development. It can make fault tolerance difficult to code for. And what do you do if you need to start the service on a different machine that has a different IP address? We could also cre- ate and attempt to maintain complex configurations, but in the modern world of cloud computing IP addresses fluctuate every time you launch an instance. So, keep- ing those configuration files up to date would be extremely complicated and prone to error. That is certainly not an option.
  3. require &apos;watirgrid&apos;require &apos;pp&apos;# Start a Controllercontroller = Controller.newcontroller.start# Start a Provider with SafariWatirprovider = Provider.new(:browser_type =&gt; &apos;safari&apos;)provider.startgrid = Watir::Grid.newgrid.start(:take_all =&gt; true)# Look at the Gridpp grid.browsers.first# Take the first browser on the grid and execute some Watirb = grid.browsers.first[:object].new_browserb.goto &quot;http://altentee.com&quot;b.close
  4. require &apos;watirgrid&apos;# Start a Controller using defaultscontroller = Controller.newcontroller.start# Start 2 Providers with WebDriver2.times do provider = Provider.new(:browser_type =&gt; &apos;webdriver&apos;) provider.startend# Start another Gridgrid = Watir::Grid.newgrid.start(:take_all =&gt; true)browser_types = [:firefox, :chrome]threads = [] grid.browsers.each_with_index do |browser, index| threads &lt;&lt; Thread.new do b = browser[:object].new_browser(browser_types[index]) b.goto &quot;http://altentee.com&quot; sleep 5 b.close end endthreads.each {|thread| thread.join}
  5. require &apos;watirgrid&apos;# Start a Controller using defaultscontroller = Controller.newcontroller.start# Start 2 Providers with WebDriver2.times do provider = Provider.new(:browser_type =&gt; &apos;webdriver&apos;) provider.startend# Start another Gridgrid = Watir::Grid.newgrid.start(:take_all =&gt; true)browser_types = [:firefox, :chrome]threads = [] grid.browsers.each_with_index do |browser, index| threads &lt;&lt; Thread.new do b = browser[:object].new_browser(browser_types[index]) b.goto &quot;http://altentee.com&quot; sleep 5 b.close end endthreads.each {|thread| thread.join}
  6. require &apos;watirgrid&apos;# Start a Controller using defaultscontroller = Controller.newcontroller.start# Start 2 Providers with WebDriver2.times do provider = Provider.new(:browser_type =&gt; &apos;webdriver&apos;) provider.startend# Start another Gridgrid = Watir::Grid.newgrid.start(:take_all =&gt; true)browser_types = [:firefox, :chrome]threads = [] grid.browsers.each_with_index do |browser, index| threads &lt;&lt; Thread.new do b = browser[:object].new_browser(browser_types[index]) b.goto &quot;http://altentee.com&quot; sleep 5 b.close end endthreads.each {|thread| thread.join}
  7. require &apos;watirgrid&apos;# Start another Gridgrid = Watir::Grid.newgrid.start(:take_all =&gt; true)threads = [] grid.browsers.each do |browser| threads &lt;&lt; Thread.new do b = browser[:object].new_browser b.goto(&quot;http://www.google.com&quot;) b.text_field(:name, &apos;q&apos;).set(&quot;watirgrid&quot;) b.button(:name, &quot;btnI&quot;).click b.close end endthreads.each {|thread| thread.join}
  8. $SAFE=1The environment variables RUBYLIB and RUBYOPT are not processed, and the current directory is not added to the path.The command-line options -e, -i, -I, -r, -s, -S, and -x are not allowed.Can&apos;t start processes from $PATH if any directory in it is world-writable.Can&apos;t manipulate or chroot to a directory whose name is a tainted string.Can&apos;t glob tainted strings.Can&apos;t eval tainted strings.Can&apos;t load or require a file whose name is a tainted string.Can&apos;t manipulate or query the status of a file or pipe whose name is a tainted string.Can&apos;t execute a system command or exec a program from a tainted string.Can&apos;t pass trap a tainted string.ACLsThis will bind the controller to the localhost (127.0.0.1) and deny all access to the controller by default, whilst allowing access from localhost only. The ACL constructor takes an array of strings. The first string of a pair is always “allow” or “deny”, and it’s followed by the address or addresses to allow or deny access.SSLusing Rinda over SSL has one small draw- back: we lose the ability for Rinda to dynamically bind to any available port. This affects only the server code. The client still is completely unaware of where the serv- ice is and uses the RingServer to find the service’s location.
  9. The default ID converter, DRb::DRbIdConv, has one downside. If you’re not careful, referenced objects on the server can become garbage-collected and are no longer avail- able when the client tries to reference them. Although the client has a pointer to the local DRb::DRbObject it got from the server, the server itself may no longer have a pointer to the object that is referenced from the client. In that case it becomes eligible for garbage collection. One solution to this problem is to use the DRb::TimerIdConv class. A better approach to solve the garbage-collection problem lies in your architec- ture. Don’t take an object from the server and hold onto it in the client for any longer than you absolutely need to. Retrieve the object from the server, use it, and then get rid of it. If you want to make sure you have access to that same referenced object min- utes, hours, or days later, you should consider writing your own custom ID converter that stores your objects in something other than the ObjectSpace.