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
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
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
\n
\n
\n
\n
\n
\n
\n
\n
\n
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
\n
Some people are doing this with Hudson.\n\nI’m running tests using resque as an asynchronous job queuing system.\n