无法在端口 7055 上连接到主机 127.0.0.1 [英] Unable to connect to host 127.0.0.1 on port 7055

查看:48
本文介绍了无法在端口 7055 上连接到主机 127.0.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 webdriver 的新手,需要一些帮助..

I am a newbie with webdriver and need some help..

我在 Windows XP 上使用 Selenium 2.2.0 和 FF v7.0.1

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

我已经成功地在 IE 中录制和播放了一个 java 脚本,但是每当我尝试在 FF 中执行相同的脚本时,我都会收到以下错误消息:

I've managed to record and play back a java script successfully in IE but whenever I try and execute the same script in FF, I get the following error message:

45000 毫秒后无法通过端口 7055 连接到主机 127.0.0.1

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

我在许多地方读到,如果我将 firefox 版本降级到 3.6 脚本会正常工作,但我并不热衷于降级.有人可以告诉我我做错了什么吗?

I've read at numbe of places that if I downgrade the firefox version to 3.6 script will work fine however I am not to keen on downgrading. 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;
    }
}

}

推荐答案

您使用的 selenium 版本非常旧.我认为 v2.2 不支持 Firefox 10.最新的是2.20.

The selenium version you are using is extremely old. I don't think firefox 10 is supported in v2.2. The latest is 2.20.

此处查看更改日志.从这里的注释来看,从 v2.19.0 开始支持 firefox 10 中的原生事件,这意味着您需要 2.19 或更高版本才能支持 firefox 10.

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

这篇关于无法在端口 7055 上连接到主机 127.0.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆