Failed to connect to host 127.0.0.1 on port 7055

I am new to webdriver and need some help.

I am using Selenium 2.2.0 with FF v7.0.1 on Windows XP

I was able to write and play a java script in IE, but whenever I try to execute the same script in FF, I get the following error message:

Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

I read in several places that if I downgrade firefox to 3.6 script, it will work fine, but I will not aim to downgrade. Can someone please tell me what I am doing wrong?

package hisScripts; import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; public class WebdriverTest_1 { private WebDriver driver; private String baseUrl; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { driver = new FirefoxDriver(); //driver=new InternetExplorerDriver(); baseUrl = "https://**********/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testUntitled() throws Exception { driver.get(baseUrl + "/"); driver.findElement(By.xpath("//a[contains(text(),'my profile')]")).click(); driver.findElement(By.xpath("//a[contains(text(),'about the service')]")).click(); driver.findElement(By.xpath("//a[contains(text(),'contact us')]")).click(); driver.findElement(By.xpath("//a[contains(text(),'help')]")).click(); driver.findElement(By.xpath("//a[contains(text(),'home')]")).click(); driver.findElement(By.xpath("//a[contains(text(),'logout')]")).click(); } @After public void tearDown() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } } private boolean isElementPresent(By by) { try { driver.findElement(by); return true; } catch (NoSuchElementException e) { return false; } } 

}

+7
source share
2 answers

The version of selenium used is extremely old. I do not think firefox 10 is supported in version 2.2. The latter is 2.20.

Take a look at the change log here . Of the notes, native events in firefox 10 were supported here, starting from version v2.19.0, which means that you will need 2.19 or higher to support firefox 10.

+8
source

This issue is related to the compatibility of the fire fox version and the selenium jar file version. Use the latest selenium jar files. This may fix the problem.

-one
source

All Articles