Posts tagged ‘Selenium Grid’

Don’t miss this important note if your planning to run tests against Internet Explorer using Selenium Grid

I tried to run tests in parallel against IE using the selenium grid for a few days before I found this important message on the selenium grid FAQ.
Picture 9

If you try to run multiple selenium remote controls for IE on one machine it will work for a while.   Your test will execute without any problems, but then you start getting sporadic error messages from IE.  I assumed that the xpath expressions I was using for the tests in Firefox were throwing errors in IE.  I tried different configurations for security settings in IE for a while and then I finally found out that it was a memory sharing issue that prevents the selenium remote from launching more than one IE instance.  For now I am just requesting more VMs to run a single IE remote on each.  I use ruby with deep test to run test in parallel on the grid.  I configure deep test to run 6 tests at a time, so I would only need 6 VMs for IE to run.

It puzzling to me that Watin tests run in parallel against IE without any problems on the same machine, but selenium tests cannot.  For now I will add more VMs and wait for Selenium Grid 1.2  to fix the IE problem.

Use custom Firefox profiles with selenium grid.

I started using custom Firefox profiles so that I could get around the self signed cert error in firefox.  I found a way to easily maintain one configured profile that is used across all Selenium remote control environments running on OS X and multiple windows versions.

  1. Download the selenium grid software.  I am using selenium-grid-1.0.4
  2. Create a new directory called SeleniumFireFoxProfile  in your selenium-grid-1.0.4 directory.
  3. Start your remote control using the custom profile. rake all:start SELENIUM_ARGS=”-firefoxProfileTemplate SeleniumFireFoxProfile”
  4. Create a test script to open a selenium client driver and navigate to the site that is getting the ssl cert error. Use a debugger to pause the execution of your script at the browser.open command
  5. Execute your script to the break point and accept the cert in your Firefox browser.
  6. Look for the creation of the cert_override.txt file in your user directory.   With Firefox 3.0 I found it on my mac in /private/var/folders.  I cd to the contained directory and run a find command to locate it sudo find . -name cert_override.txt. With Firefox 3.5 the profile is stored in the user directory ~/Library/Application Support/Firefox/Profiles.
  7. You should see an entry in your cert_override.txt file after you accept the certificate. Now copy the cert_override.txt from your user directory to your SeleniumFireFoxProfile directory in your selenium grid directory.
  8. Restart your remote control now using the profile with the cert_override.txt file in it.  Rerun your test and break on the open command now you should see your page render instead of the security warning.

Just a warning about the cert_override.txt file.  It is very white space sensitive, it is better to copy the whole file into your custom profile directory rather then copying a new line into an existing file.

I check in the override text file along with my selenium software.  This way I can add a cert on my local machine and then run a SVN update on the distributed grid hosts to get the new cert information. This works for both windows and OS X.