Running Firefox Against Selenium 2

| | TrackBacks (0)

I’ve had a hard time running tests using Selenium Server 2.0b2 on a Firefox browser (on Windows 7).  I tried following the suggestions of adding the path to my firefox.exe to my PATH, but no such luck.  The error message also suggested

Please add the directory containing ''firefox.exe'' to your PATH environment variable, or explicitly specify a path to Firefox 3 like this:
*firefox3c:\blah\firefox.exe on session null

That proved frustrating as well.  However, the addition of a simple space proved to be the key.

My setUp() method now looks like this ( of course this is hardcoding firefox.  I haven’t gone in and cleaned that up yet):

 

   1:  @BeforeClass(  )
   2:  @Parameters({"browser", "seleniumGridIp", "seleniumGridPort", "testServer", "testEnv" })
   3:  public void setUp( String browser, String seleniumGridIp,
   4:          int seleniumGridPort, String testServer, String testEnv) throws Exception {
   5:          
   6:          browser = "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
   7:          sel = new DefaultSelenium(     seleniumGridIp,
   8:                  seleniumGridPort,
   9:                  browser,
  10:                  testServer);
  11:   
  12:          sel.start();
  13:          sel.open(testServer);
  14:   
  15:      }

 

I hope this helps someone.   It’s not an ideal solution…. but it works.

0 TrackBacks

Listed below are links to blogs that reference this entry: Running Firefox Against Selenium 2.

TrackBack URL for this entry: http://www.estevenjones.com/cgi-bin/mt/mt-tb.cgi/50

 

 

The Tao of Calvin