Tag: geb

geb.driver.DriverCreationException:无法从回调创建驱动程序

我正在设置一些Geb测试,我得到“geb.driver.DriverCreationException:无法从回调创建驱动程序”错误。 Geb将尝试启动测试浏览器窗口,但一旦它启动,我的测试都没有运行,我得到上述错误。 我刚刚对Firefox 32.0.2进行了自动Firefox更新,所以我怀疑新版本和Selenium Web Driver不再玩得很好了吗? 我该如何解决这个问题? 这是我一直在使用的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 }

即使我在正确的域上,Selenium addCookie也会获得无效的Cookie域exception

所以我试图用Selenium / Geb将以前保存的cookie加载到我的网络驱动程序中。 首先,我转到域名,然后尝试添加cookie。 但cookie域和url域不相互注册: Caught: org.openqa.selenium.InvalidCookieDomainException: You may only add cookies that would be visible to the current domain: .domain=.example.com => .www.example.com Build info: version: ‘2.35.0’, revision: ‘8df0c6bedf70ff9f22c647788f9fe9c8d22210e2’, time: ‘2013-0 8-17 12:46:41’ System info: os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.2.0-48-generic’, java.version: ‘1.6.0_27’ Driver info: driver.version: unknown 似乎cookie的域名是.example.com ,当我访问http://example.com时,我所访问的域名是.www.example.com 。 我能想到的唯一解决方案是覆盖一些方法来欺骗我当前的域名,但我不知道如何去做。

从java类运行geb测试

我最近偶然发现了geb ,它看起来像是在我们的Web应用程序上执行集成测试的好方法。 我们的平台都是基于java的,从阅读它 “通过与流行的测试框架集成,例如…… JUnit,TestNG ……,Geb为function性Web测试提供了一流的支持。” 我假设从java类执行测试很容易(testng测试?)。 我是groovy和geb的新手。 到目前为止,我已经在我的pom中包含了geb-testng和groovy: org.codehaus.geb geb-testng 0.7.0 org.codehaus.groovy groovy 1.8.6 …但是我找不到任何创建测试并从java类运行它的示例。 帮助赞赏。

为什么我的Geb测试返回“无法从回调中创建驱动程序”,即使在Grails中更新我的Selenium依赖项后?

我正在引用此前一个线程( geb.driver.DriverCreationException:无法从回调创建驱动程序 ) – 但我仍然遇到问题。 我正在尝试在Grails 2.4.3下运行Gebfunction测试,并且我将Selenium支持依赖项设置为版本2.42.2。 我也尝试过2.43.1和2.45.0。 如果我尝试使用Selenium 2.42.2或2.43.1,Geb将停止运行并且不会完成,如果我使用2.45.0,它将彻底崩溃。 这些是我得到的错误: 如果我尝试Selenium支持2.42.2或2.43.1,我收到此错误:geb.driver.DriverCreationException:无法从回调创建驱动程序 如果我尝试Selenium支持2.45.0 – 我的浏览器将尝试运行Geb测试,但会返回“页面不是直接正确”错误。 在我的Grails BuildConfig.groovy中,这是我现在设置的selenium依赖项: def seleniumVersion = “2.45.0” dependencies { // specify dependencies here under either ‘build’, ‘compile’, ‘runtime’, ‘test’ or ‘provided’ scopes eg // runtime ‘mysql:mysql-connector-java:5.1.29’ // runtime ‘org.postgresql:postgresql:9.3-1101-jdbc41’ compile ‘org.dbunit:dbunit:2.5.0’ test “org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion” test “org.gebish:geb-spock:$gebVersion” compile “org.springframework:spring-orm:4.0.5.RELEASE” // need for select […]