= WatirGrid WatirGrid allows for distributed testing across a grid network using Watir. == Getting Started To install WatirGrid: gem install watirgrid === The Basics WatirGrid is built on Rinda which implements the Linda distributed computing paradigm in Ruby. According to Wikipedia: “Linda is a model of coordination and communication among several parallel processes operating upon objects stored in and retrieved from shared, virtual, associative memory.” In other words, WatirGrid allows multiple parallel processes to *_provide_* remote Watir objects in the form of tuple spaces across a grid network. This grid network is *_controlled_* by a ring server. ==== Key Terminology The *controller* implements a repository of tuples (tuple space) that can be accessed concurrently. The controller also hosts a *ring* *server* which advertises these tuples across a grid network making it loosely coupled. Typically you will host one controller on a central machine. You will normally connect to this controller via a direct URI. You can also find this controller by its ring server, using a UDP broadcast for the ring server port. The *providers* make remote Watir objects available to the tuple space hosted by the *controller*. 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, Safari or WebDriver browser object. === Simple Example Pick a server to host the 'controller' for the ring server and execute the following: $ controller This should find your external facing IP and start the corresponding DRb and Ring Servers: I, [2011-04-09 18:06:19 #1971] INFO -- : Controller started on : druby://127.0.0.1:11235 On each client PC, host the 'provider' for the distributed (DRb) Watir objects $ provider -b ie -c druby://127.0.0.1:11235 This should find the recently started Ring Server and register a tuple for the Watir object: I, [2011-04-09 18:06:26 #1972] INFO -- : Provider started on : druby://127.0.0.1:11236 I, [2011-04-09 18:06:26 #1972] INFO -- : Controller found on : druby://127.0.0.1:11235 I, [2011-04-09 18:06:26 #1972] INFO -- : Provider registered : druby://127.0.0.1:11235 You will now be able to execute commands across remote browsers on your grid network. e.g. require 'watirgrid' Watir::Grid.control(:controller_uri => 'druby://127.0.0.1:11235') do |browser, id| puts "My remote browser id is #{id}" browser.goto("http://www.google.com") browser.text_field(:name, 'q').set("watirgrid") browser.button(:name, "btnI").click end You may wish to host the controller and providers on different machines in a real scenario. You can specify things like server hostnames, ports and access control lists for each of the different types of servers. For more help see: $ controller --help Usage: controller [options] Specific options: -H, --drb-server-host [HOST] Specify DRb Server interface to host on -d, --drb-server-port [PORT] Specify DRb Server port to listen on -h, --ring-server-host [HOST] Specify Ring Server interface to host on -r, --ring-server-port [PORT] Specify Ring Server port to listen on -a, --access-control-list [ACLS] Specify a comma separated Access Control List -l, --log-level [LEVEL] Specify log level {DEBUG|INFO|ERROR} --help Show this message $ provider --help Usage: Usage: provider -b BROWSER_TYPE [options] Specific options: -b, --browser-type TYPE Specify browser type to register {ie|firefox|safari|webdriver} -c, --controller-uri [URI] Specify Controller URI e.g. druby://127.0.0.1:11235 -H, --drb-server-host [HOST] Specify DRb Server interface to host on -d, --drb-server-port [PORT] Specify DRb Server port to listen on -h, --ring-server-host [HOST] Specify Ring Server host to connect to -r, --ring-server-port [PORT] Specify Ring Server port to broadcast on -a, --access-control-list [ACL] Specify a comma separated Access Control List -l, --log-level [LEVEL] Specify log level {DEBUG|INFO|ERROR} --help Show this message == Copyright Copyright (c) 2009-2011 Tim Koopmans. See LICENSE for details.