Ma Kro
Ma Kro

Reputation: 1242

Selenium cannot find firefox path - selenium-webdriver

I've got automation framework written in ruby. I get Could not find Firefox binary (os=windows). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path= (Selenium::WebDriver::Error::WebDriverError)

Of course I've got firefox installed. I tried reinstallation of firefox and ruby, and selenium-webdriver gem and I get this error message. I cannot hardocde path in my tests, it must be setup globally. I tried changing selenium-webdriver .rb files, but nothing helped.

Upvotes: 1

Views: 1348

Answers (1)

djangofan
djangofan

Reputation: 29689

I would recommend setting up a GridHub using Selenium using something like this as the configuration:

{
    "capabilities":
    [
        {
            "browserName": "firefox",
            "acceptSslCerts": true,
            "javascriptEnabled": true,
            "takesScreenshot": false,
            "firefox_profile": "",
            "firefox_binary": "C:\Program Files (x86)\Mozilla Firefox\firefox.exe",
            "browser-version": "35.0.1",  
            "platform": "WINDOWS",                     
            "maxInstances": 5
        },
        {
            "browserName": "chrome",
            "maxInstances": 5,
            "platform": "WINDOWS"
        },
        {
            "browserName": "internetExplorer",
            "maxInstances": 1,
            "platform": "WINDOWS"
        }
    ],
    "configuration":
    {
        "_comment" : "This is configuration for the grid node 1.",
        "cleanUpCycle": 2000,
        "timeout": 30000,
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "port": 5555,
        "host": ip,
        "register": true,
        "hubPort": 4444,
        "maxSessions": 5
    }
}

Once it is up and running , go to this URL:

http://127.1:4444/grid/console

Upvotes: 1

Related Questions