FirefoxDriver 不启动任何 URL 并执行任何操作

FirefoxDriver do not launch any URL and perform any action

我已经使用 Eclipse Neon、最新的 Selenium 3.7.1 和 Firefox 52.4 启动了一个清晰的 CentOS。 我正在尝试调用任何 URL 但 Firefox 启动但什么也不做。我没有任何代理。

我试图用这样的默认页面启动 Firefox:

FirefoxProfile fp = new FirefoxProfile();
fp.setPreference("browser.startup.homepage", URL);
fp.setPreference("startup.homepage_welcome_url", URL);
fp.setPreference("startup.homepage_welcome_url.additional", URL);

成功了,只是打开了页面,仅此而已。

是通病吗?我该如何解决这个问题?

您提到使用 Selenium 3.7.1 and Firefox 52.4

GeckoDriver 的发行说明明确提到:

Note that with geckodriver 0.19.0 the following versions are recommended: - Firefox 55.0 (and greater) - Selenium 3.5 (and greater)

所以当你在使用时,Selenium 3.7.1你不能在geckodriver 0.19.0下面使用。因此,您的解决方案是将 Firefox 提高到 v56.x 水平。