我尝试使用最后的 groovy 2.5.8 和 geb-core 3.2。
例如
@Grapes([
@Grab("org.gebish:geb-core:3.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"),
@Grab("org.seleniumhq.selenium:selenium-support:3.141.59")
])
import geb.Browser
browser = new Browser()
println "Hello from test"
生成错误
C:\PROJ\bitb\checkBoard\test>groovy runTest.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during conversion: Conflicting module versions. Module [groovy-xml is loaded in version 2.5.8 and you are trying to load version 2.5.6
如果我将 geb-core 更改为 2.3.1,它可以正常工作。也许我应该更改一些配置?
提前致谢!
最佳答案
Geb 依赖于 Groovy,但运行脚本时您已经加载了 Groovy - 您需要排除 Groovy 模块:
@Grapes([
@Grab("org.gebish:geb-core:3.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"),
@Grab("org.seleniumhq.selenium:selenium-support:3.141.59"),
@GrabExclude("org.codehaus.groovy:groovy-all")
])
关于groovy - Geb-core 3.2 与 groovy 2.5.8 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58658668/