Google Analytics

Search

To search for specific articles you can use advanced Google features. Go to www.google.com and enter "site:darrellgrainger.blogspot.com" before your search terms, e.g.

site:darrellgrainger.blogspot.com CSS selectors

will search for "CSS selectors" but only on my site.


Wednesday, February 17, 2010

what goes where with Selenium RC?

When using Selenium RC. You have five machines, conceptually:
  1. The Application Server (and the application you are testing)
  2. The Web Server
  3. The web browser (client)
  4. The Selenium Server
  5. The Selenium Client
The reality is that the web browser and the Selenium server are the same machine. Additionally, there is no reason you cannot be running everything on one machine. Let's say we have unlimited machine and we want to test on a number of different platforms with a variety of different browsers. Here is a theoretical setup:

  1. Application Server
  2. Web Server
  3. Windows XP, Internet Explorer 6, Selenium Server #1
  4. Windows Vista, Internet Explorer 7, Selenium Server #2
  5. Windows 7, Internet Explorer 8, Selenium Server #3
  6. Linux, Firefox 3.5, Selenium Server #4
  7. Mac OS X, Safari 4.0, Selenium Server #5
  8. Build Machine with Test Suite
  9. Database
  10. Subversion repository with application and test suite source code
Here is how communication will flow:
  1. Machine #8 will check out the code from machine #10
  2. Machine #8 will compile the application
  3. Machine #8 will tell machine #1 to stop the application server
  4. Machine #8 will deploy the application to the application server
  5. Machine #8 will make any necessary changes to the database
  6. Machine #8 will tell machine #1 to start the application server
  7. Machine #8 will compile the test suite code
  8. Machine #8 will start the Selenium Server on machines 3, 4, 5, 6 and 7
  9. Machine #8 will run, in parallel, five copies of the test suite, each one configured to point to a different test machine
  10. Assuming the test runner used on step 9 creates test results, machine #8 will save the test results.
  11. If may also send an email to interested parties
During step 9 there will be the following call in the Test Suite:

    Selenium selenium = new DefaultSelenium(seleniumServer, seleniumPort, browser, baseURL);

where seleniumServer/seleniumPort is the IP address and network port of the machine running the test. If we have this parameter configurable, we can configure the parameter to the selenium server on machine 3 then run it, configure the parameter to machine 4 then run it again, and so on.

The browser parameter would be "*iexplore" for machines 3, 4, 5, "*firefox" for machine 6 and "*safari" for machine 7. The baseURL is going to be the URL for machine #2, which redirects HTTP requests to our application on machine #1.

If  your test code is written in Java, everything can be done so long as some version of Java is installed on all the machines. You could even test your application on Firefox and Solaris 10.

No comments: