0

I am unable to run my tests on Firefox 48 using latest Selenium versions (2.53, Selenium 3 beta).

Please explain the configuration needed and the code to use to successfully run tests on Firefox 48. I have pointed to the geckodriver and tried to initialise the same in my code.

Code:

System.setProperty("webdriver.gecko.driver","E:\\Work\\Selenium\\geckodriver-v0.9.0-win64\\geckodriver.exe");
WebDriver driver = null;
driver = new MarionetteDriver();

Getting the below:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Atul Dwivedi
  • 1,452
  • 16
  • 29
Balaji
  • 1
  • 3

3 Answers3

1

Worked for me:

System.setProperty("webdriver.gecko.driver", "PATH TO GECKO DRIVER");
DesiredCapabilities ffCapabilities = DesiredCapabilities.firefox();
ffCapabilities.setCapability("marionette",true);
WebDriver driver = new FirefoxDriver(ffCapabilities);
Ranjith's
  • 4,508
  • 5
  • 24
  • 40
0

You need to write DesiredCapabilities. Add this line before driver initialization.

DesiredCapabilities cap = DesiredCapabilities.firefox()

QA Square
  • 245
  • 1
  • 3
0

You can download geckodriver from the link https://github.com/mozilla/geckodriver/releases Then save the file in your local system. unzip the file and change the application name as "wires.exe". Then specify the path upto wires.exe in the code.

add selenium-2.53.0 jar files.

Try below code to start working on FF 47.0 or above.

package com.marionette.programs;

import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.MarionetteDriver;

public class HandleLatestFirefox {

public static void main(String[] args) {
    String currentDir = System.getProperty("user.dir");
    System.out.println(currentDir);
    //String marionetteDriverLocation = currentDir + "G:\\ravik\\Ravi-Training\\Selenium\\Marionette for firefox\\wires.exe";
    System.setProperty("webdriver.gecko.driver", "G:\\ravik\\Ravi-Training\\Selenium\\Marionette for firefox\\wires.exe");
    WebDriver driver = new MarionetteDriver();
    driver.get("https://www.google.co.in/webhp?hl=en&sa=X&ved=0ahUKEwjdgc21jJHOAhVCvY8KHZ4aCdcQPAgD");
    System.out.println("marionette working fine....");

}

}

Ravi Potnuru
  • 191
  • 4
  • 13