0
    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.

I am getting this error while I try to run the project using webdriver. Using the following versions:

  • Mozilla FF ver- 53.0.3
  • WebDriver -3.4.0

How to fix the issue?

package newpackage;

import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.remote.DesiredCapabilities;

public class MyClass {
    
    public static void main(String[] args)
    {
        
        System.setProperty("webdriver.gecko.driver", "D:\\...\\Geckodriver\\geckodriver.exe");
        
        /*DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        //capabilities.setCapability("marionette", true);
        //WebDriver driver = new FirefoxDriver(capabilities);*/
         //declaration and instantiation of objects/variables
        WebDriver driver= new FirefoxDriver();
        
        String baseUrl = "https://google.com";
        String expectedTitle = "Welcome:";
        String actualTitle = "";
        
        // launch firefox and redirect it to the base URL
        driver.get(baseUrl);
        
        // get the actual value of the title
        driver.getTitle();
        
        /*
         * compare the actual title of the page with the expected one and print
         * the result as "Passed" or "Failed"
         */
          if(actualTitle.contentEquals(expectedTitle)){
              System.out.println("Test Passed!");
          }else {
              System.out.println("Test Failed");
          }
          
          //close Firefox
          driver.close();
          
          // exit the program
          System.exit(0);
        
    }
  • Please include the code where you setup the webdriver. – kirbycope Jun 12 '17 at 17:51
  • is there any way out or do i need to downgrade them all – ashu Jun 13 '17 at 7:08
  • I do not recommend downgrading as that doesn't happen in the wild. Update Firefox to 54.0, geckodriver to 0.17.0, and Selenium to 3.4.0. – kirbycope Jun 13 '17 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.