我正在设置一些 Geb 测试,但收到“geb.driver.DriverCreationException:无法从回调创建驱动程序”错误。 Geb 将尝试启动测试浏览器窗口,但一旦启动,我的任何测试都不会运行,并且出现上述错误。
我刚刚将 Firefox 自动更新到 Firefox 32.0.2,所以我怀疑新版本和 Selenium Web 驱动程序不再运行良好?我该如何解决这个问题?
这是我一直在使用的 Geb.config 文件?我大约 5 个月没有更改它,直到现在都运行良好......
import org.openqa.selenium.firefox.FirefoxDriver
import geb.waiting.WaitingSupport
reportsDir = "target/geb-reports"
driver = {
//path is specific to each machine. This is the path to firefox.exe
def pathToBin = 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'
System.setProperty("webdriver.firefox.bin",pathToBin)
def driverInstance = new FirefoxDriver();
driverInstance.manage().window().maximize()
driverInstance
}
最佳答案
确实是我想的那样。将 jar 依赖项升级到 Selenium 2.43.1 并且工作正常。之前用的是2.42.2
关于java - geb.driver.DriverCreationException : failed to create driver from callback,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25940929/