【发布时间】:2017-02-08 10:50:06
【问题描述】:
我在使用 Selenium 打开 Firefox 时遇到了一些困难。它可以在我家里的电脑上运行,但我不确定为什么它不能在我的工作电脑上运行。非常感谢您对此提供一些帮助和指导,因为我是该工具和 eclipse 的新手。
我已经下载了 geckodriver 10,并且正在运行带有 Eclipse Neon 的 Selenium 3。我将 selenium-server-standalone-3.0.0-beta3 导入到我的测试 Selenium 项目的 Java 构建路径。
我的代码如下:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class openBrowser {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "D:\\JW\\Selenium\\geckodriver-v0.8.0-win32\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://www.google.com");
}
}
当我运行程序时,我会在控制台中看到以下内容:
Sep 30, 2016 10:42:18 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO:尝试双语会话,假设 Postel 定律在远程端成立 线程“主”org.openqa.selenium.remote.UnreachableBrowserException 中的异常:无法启动新会话。可能的原因是远程服务器地址无效或浏览器启动失败。 构建信息:版本:'3.0.0-beta3',修订:'c7b525d',时间:'2016-09-01 14:57:03 -0700' 系统信息:主机:'SBC-40489825',ip:'10.27.20.46',os.name:'Windows 7',os.arch:'x86',os.version:'6.1',java.version:'1.8 .0_73'
我运行该程序,但由于连接似乎被拒绝,firefox 似乎从未打开过任何想法有什么问题吗?
最好的问候
塔昆
【问题讨论】:
标签: java eclipse selenium geckodriver