Go to the examples/ec2 directory within the Selenium
Grid distribution and check that everything works as expected:
cap ec2:check_settings
Edit the Capfile to reflect the number of EC2 instances
that you are willing to launch. The relevant line is
set :remote_control_farms_count, 5
Boot all your EC2 instances with:
cap grid:boot
Be patient, booting EC2 instances can take a while...
You can then view the current state of your Selenium Grid with
cap grid:info
You can start Selenium Grid Hub, Remote Controls and VNC on the EC2 grid you just booted with:
cap grid:start
You can view the Selenium Grid Hub Console with:
cap hub:console
You can also VNC to all the Remote Controls with:
cap rc:view
To run Selenium tests against the EC2 grid you need to know the DNS name of the Selenium Grid Hub. You can discover it by running:
cap grid:info
From know let's assume the Hub DNS name is
ec2-67-202-25-36.compute-1.amazonaws.com
You can then navigate back to the root of Selenium Grid distribution:
cd ../..
... and run the demo with:
ant -DseleniumHost=ec2-67-202-25-36.compute-1.amazonaws.com run-demo-in-parallel
You can then visualize browsers running the tests in your VNC windows.
Once you are done experimenting with Selenium Grid on EC2 you can shutdown all the EC2 instances (and stop be charged for it) with:
cap grid:shutdown
You can double-check that everything has been stopped properly:
ec2-describe-instances | grep running
Stay tuned for more documentation on Selenium Grid integration
with EC2. In the meantime you can explore other feature by
running in the examples/ec2 directory:
$ cap -T
cap ec2:check_settings # Check EC2 related configuration.
cap grid:boot # Boot EC2 Instances for a Selenium Grid of 1 Hub and ...
cap grid:info # Display infoemation about current Selenium Grid
cap grid:shutdown # Shutdown EC2 Instance used to run Selenium Hub.
cap grid:start # Start Selenium Grid Hub.
cap grid:stop # Stop Selenium Grid Hub.
cap hub:boot # Boot a new EC2 Instance to Run Selenium Grid Hub.
cap hub:console # Open Selenium Grid Hub Console in a browser.
cap hub:logs # View Selenium Grid Hub logs.
cap hub:restart # (Re)start Selenium Grid Hub.
cap hub:shutdown # Shutdown EC2 Instance used to run Selenium Hub.
cap hub:start # Start Selenium Grid Hub.
cap hub:stop # Stop Selenium Grid Hub.
cap invoke # Invoke a single command on the remote servers.
cap rc:boot # Boot a new EC2 Instance to run a collection of Selen...
cap rc:restart # (Re)start Remote Controls for all farms.
cap rc:shutdown # Shutdown all EC2 Instances used to run Selenium Grid...
cap rc:start # Start Remote Controls for all farms.
cap rc:stop # Stop Remote Controls for all farms.
cap rc:view # Visualize what is happening in Remote Control Farms ...
cap rc:vnc:start # Start VNC server on all Remote Control Farms