Selenium打开Firefox时遇到了一些困难。它可以在家里的电脑上运行,但我不确定它为什么不能在我的工作计算机上工作。一些帮助和指导,将非常感谢,因为我是这个工具和日食的新手。Selenium无法使用geckodriver 10.0打开Firefox - 无法访问浏览器例外
我已经下载了geckodriver 10并且正在用Eclipse Neon运行Selenium 3。我将Selenium-server-standalone-3.0.0-beta3导入到我的测试Selenium项目的Java Build Path中。
我的代码如下:
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
信息:试图双向方言会话,假设普天定律成立在远程端 线程“main”中的异常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从来没有似乎打开,因为连接似乎被拒绝任何想法什么是错的?
问候
塔奎