QA/Execution/Web Testing/Automation/Selenium Grid: Difference between revisions
Line 31: | Line 31: | ||
**Jenkins (http://qa-selenium.mv.mozilla.com:8080/) | **Jenkins (http://qa-selenium.mv.mozilla.com:8080/) | ||
**Selenium Grid Hub (http://qa-selenium.mv.mozilla.com:4444/grid/console) | **Selenium Grid Hub (http://qa-selenium.mv.mozilla.com:4444/grid/console) | ||
*'''qa-selenium2'''.mv.mozilla.com (10.250.1.167) | *'''qa-selenium2'''.mv.mozilla.com (10.250.1.167) -- '''NO LONGER USED''' | ||
- | |||
*'''qa-selenium3'''.mv.mozilla.com (10.250.1.196) | *'''qa-selenium3'''.mv.mozilla.com (10.250.1.196) | ||
**Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB | **Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB |
Revision as of 00:42, 14 January 2012
Selenium Grid
moz-grid-config
- moz-grid-config is our project for managing the Selenium Grid hub, nodes and configuration of them. It packages it all together so that starting the grid is simple a matter of running 'ant launch-hub' or 'ant launch-node'.
- moz-grid-config requires Git for checking out the project and Apache ant and Java for running the grid and nodes.
- moz-grid-config is configured for Mozilla's architecture but it can be used locally by changing the hub.host and node.configuration in default.properties to represent your local settings. You may also need to change the path to your browser binaries in the json files.
Starting the Hub
- VNC into or use Screen, and go on qa-selenium.mv.mozilla.com,
- start a screen session -> screen -S selenium_grid_hub
- cd moz-grid-config
- start the hub -> ant launch-hub
Starting Selenium node
- VNC into or use Screen, and go to each individual node,
- start a screen session -> screen -S selenium_rc
- cd moz-grid-config
- start the node -> ant launch-node
Shutdown
- Use <control> c
Architecture
- qa-selenium.mv.mozilla.com (10.250.1.143)
- Mac Mini; 2.66 Ghz Intel Core 2 Duo; 8 GB
- Mac OS X 10.6.8
- Jenkins (http://qa-selenium.mv.mozilla.com:8080/)
- Selenium Grid Hub (http://qa-selenium.mv.mozilla.com:4444/grid/console)
- qa-selenium2.mv.mozilla.com (10.250.1.167) -- NO LONGER USED
- qa-selenium3.mv.mozilla.com (10.250.1.196)
- Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB
- Mac OS X 10.6.8
- VM: Windows 7 Professional (10.250.7.78)
- qa-selenium4.mv.mozilla.com (10.250.1.197)
- Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB
- Mac OS X 10.6.8
- VM: Windows 7 Professional (10.250.4.68)
- qa-selenium5.mv.mozilla.com (10.250.1.222)
- Mac Mini; 2.66 Ghz Intel Core 2 Duo; 8 GB
- Mac OS X 10.6.8
- VM: Windows 7 Professional (10.250.5.71)
- qa-selenium6.mv.mozilla.com (10.250.1.221)
- Mac Mini; 2.53 Ghz Intel Core 2 Duo; 4 GB
- Mac OS X 10.6.8
- VM: Windows 7 Professional (10.250.2.244)
- qa-selenium7.mv.mozilla.com (10.250.1.9)
We have several Mac Minis running various Selenium RC environments, integrated via Jenkins Continuous Build Integration and Selenium Grid. All machines can be VNC'ed into from within the MV-Office Intranet (VPN if offsite). In order to start the entire system (Jenkins, Selenium Grid, and all VMs with Selenium RCs), ensure that all the Mac Minis are powered on and logged in.
Node configuation
Since Selenium Grid 2.14.0 was released and allowed both RC and Webdriver nodes to co-exist each node runs the same configuation of browser nodes
For both Mac and Win7 nodes
Selenium RC
- Firefox 3.6 - 5 instances
- Firefox 4 - 5 instances
- Firefox 5 - 5 instances
- Firefox 6 - 5 instances
- Firefox 7 - 5 instances
- Firefox Beta - 5 instances
- Firefox Aurora - 5 instances
- Firefox Nightly - 5 instances
- Internet Explorer 8 - 1 instance
WebDriver
- Firefox 3.6 - 1 instance
- Firefox 4 - 1 instance
- Firefox 5 - 1 instance
- Firefox 6 - 1 instance
- Firefox 7 - 1 instance
- Firefox Beta - 1 instance
- Firefox Aurora - 1 instance
- Firefox Nightly - 1 instance
- Internet Explorer 8 - 1 instance
Adding a new browser environment
In the moz-grid-config repository
- https://github.com/mozilla/moz-grid-config/blob/master
- Add the browser, alias, and path to grid_configuration.yml
- Add the browser, binary and details to win7.json and mac.json
- Make sure that the path to the binary is correct and includes the correct version number
- Submit the changes as a Git pull request for approval by the team.
On the node
- The moz-grid-config project will already be configred on the node so the first step is to pull the new browser configuration files from the github master branch (as from step 5 above).
- You may also need to install the browser for the version you are adding to the grid. All new browsers should be installed with the version number in the path so that moz-grid-config can always find them!
- Download Firefox binaries: http://releases.mozilla.org/pub/mozilla.org/firefox/releases/
Installing Firefox on a Mac node
- Unpack the Firefox version to the desktop
- Rename the file to include the version number (eg 'Firefox 10.app')
- Move the file from the desktop into the Application folder
- No other changes are necessary - Selenium will manage the configuration and profile
Installing Firefox on a Win 7 node
- Run the Firefox installer and choose custom install
- Change the default install path to include the version number (eg 'C:\Program Files\Mozilla Firefox 10\')
- Complete the install and uncheck 'set as default browser'
- No other changes are necessary - Selenium will manage the configuration and profile
Jenkins
Starting Jenkins
- VPN in via Mozilla-MV to http://qa-selenium.mv.mozilla.org:8080/, look for an existing Terminal/Console window with a Jenkins process -- if there's one there, you should just be able to cursor-up and type Enter/Return to launch
- If not, we launch as follows:
java -jar -Xms2g -Xmx2g -XX:MaxPermSize=512M -Xincgc ~/Desktop/jenkins.war
Upgrading Jenkins
- Load http://qa-selenium.mv.mozilla.com:8080/ (must be on VPN)
- Click on "Manage Jenkins" - http://qa-selenium.mv.mozilla.com:8080/manage
- Click on "Prepare for Shutdown" - http://qa-selenium.mv.mozilla.com:8080/quietDown
- VNC into qa-selenium.mv.mozilla.com and go to the Terminal window and CTRL+C (you'll see Java processes shutting down)
- Now, either arrow-up, or explicitly do "java jar -Xms2g -Xmx2g -XX:MaxPermSize=512M -xincgc jenkins.war" -- this should restart Jenkins, and be it! It'll take some time for it to fully come back up, and for qatestbot to join #mozwebqa
Mac OS X-Hostname Setting (shamelessly copied, verbatim, from http://budporter.net/?p=47)
If you are running a version of OSX prior to 10.5, then look in “/etc/hostconfig” for the “HOSTNAME=” parameter and set it to be the FQDN (Fully Qualified Domain Name) that you want to use. So, for host “foo” located in the domain “bar.com”, the entry would be as follows:
HOSTNAME=foo.bar.com
For OSX 10.5, “/etc/hostconfig” is being deprecated. If you look in “/etc/hostconfig” on 10.5, you’ll see that “HOSTNAME” is no longer listed. There are a couple of preferred methods to do this in 10.5:
sudo hostname -s foo.bar.com
or
sudo scutil –set HostName foo.bar.com
You can verify the change by issuing the “hostname” command without any arguments. The output from the command will display the FQDN of your computer. The command “hostname -s” will display only the host name of your computer (minus the domain name).
Don’t let any of this confuse you with the Computer Name setting in “System Preferences–>Sharing” which really should be called “Bonjour Name”.
References
- Grid Admin Console
- Grid Hub Snapshot
- Github config snapshot