Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble in launching of firefox browser using selenium for MAC OS

I am using Selenium to test a website in Java and trying to run it in Firefox on a MAC. But when I am trying to execute the code below

Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.example.com/");

I am getting the following runtime exception

java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Browser not supported: /Users/sumitghosh/Desktop/*firefox3
(Did you forget to add a *?)

Supported browsers include:
  *firefox
  *mock
  *firefoxproxy
  *pifirefox
  *chrome
  *iexploreproxy
  *iexplore
  *firefox3
  *safariproxy
  *googlechrome
  *konqueror
  *firefox2
  *safari
  *piiexplore
  *firefoxchrome
  *opera
  *iehta
  *custom

I have also tried changing the browser to *googlechrome, but the same error was firing!

But when *safari was used it ran successfully.

Since I want the application to run on Windows and MAC also, I was trying for *firefox or *googlechrome to run, but both browsers are giving exceptions both on Windows and MAC!

like image 486
Aspirant Avatar asked Nov 04 '22 03:11

Aspirant


2 Answers

I have only ever got firefox 3.X to work on MACOSX with selenium.

Try downloading and installing a 3.X version (I got 3.18 to work).

like image 156
Bohemian Avatar answered Nov 10 '22 04:11

Bohemian


Instead of "*firefox" you can try "*firefox /Apps/Firefox/firefox.exe" or any other absolute path to the file firefox.exe which works for your computer.

like image 41
Petr Janeček Avatar answered Nov 10 '22 03:11

Petr Janeček