geb.navigator.SearchContextBasedBasicLocator do not match. Expected -1 but got 2

已查看 108 次
跳至第一个未读帖子

Mohammad Ali

未读,
2016年1月4日 19:26:412016/1/4
收件人 Geb User Mailing List
I see the following stack trace in the output after running target "test-app ahpra.AhpraTests"

java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for geb.navigator.SearchContextBasedBasicLocator do not match. Expected -1 but got 2
at geb.navigator.SearchContextBasedBasicLocator.<init>(SearchContextBasedBasicLocator.groovy:37)
at geb.navigator.factory.BrowserBackedNavigatorFactory.<init>(BrowserBackedNavigatorFactory.groovy:35)
at geb.Configuration.createNavigatorFactory(Configuration.groovy:417)
at geb.Browser.createNavigatorFactory(Browser.groovy:131)
at geb.Browser.getNavigatorFactory(Browser.groovy:119)
at geb.Page.init(Page.groovy:131)
at geb.Browser.createPage(Browser.groovy:862)
at geb.Browser.page(Browser.groovy:239)
at geb.Browser.go(Browser.groovy:510)
at geb.Browser.go(Browser.groovy:491)
at ahpra.AhpraTests$_testSomething_closure1.doCall(AhpraTests.groovy:23)
at geb.Browser.drive(Browser.groovy:1049)
at geb.Browser.drive(Browser.groovy:1019)
at ahpra.AhpraTests.testSomething(AhpraTests.groovy:22)

The project in questions has been setup as follows:

Grails 2.0.3.
JDK 1.7
Test dependencies
org.gebish:geb-junit4:0.12.2
org.seleniumhq.selenium:selenium-chrome-driver:2.32.0
org.seleniumhq.selenium:selenium-support:2.32.0

GebConfig.groovy
import org.openqa.selenium.chrome.ChromeDriver

driver = {
    System.setProperty("webdriver.chrome.driver", "C:\\dev\\chromedriver.exe")
    def driverInstance = new ChromeDriver()
    driverInstance
}

baseNavigatorWaiting = true
atCheckWaiting = true

There is one domain class called Physio and it has a single field "name" and a scaffolded controller.

The test code is as follows:
package ahpra

import geb.Browser

import static org.junit.Assert.*
import org.junit.*

class AhpraTests {

    @Before
    void setUp() {
        // Setup logic here
    }

    @After
    void tearDown() {
        // Tear down logic here
    }

    @Test
    void testSomething() {
        Browser.drive {
            go "http://www.google.com"
        }.quit()
    }
}

Mohammad Ali

未读,
2016年1月4日 20:05:042016/1/4
收件人 Geb User Mailing List
Issue was due to dependency conflict in groovy versions. 
Grails 2.0.3 relies on groovy 1.8.6 and geb 0.12.2 relies on 2.3.10.
The conflict was discovered by running grails dependency-report
I trawled maven repository database and found that geb-ast is where the transitive dependency on groovy came from.
0.9.3 of geb-ast was the last version where no explicit dependency on groovy was specified.
Downgrading geb-junit4 to 0.9.3 fixed the issue

Brian Kotek

未读,
2016年1月4日 22:07:182016/1/4
收件人 Geb User Mailing List
Good job, that probably wasn't fun to track down. I'm sure you know this (and I'm really not trying to be annoying), but Grails 2.0.3 is four years old. I know it can be hard to find the time, but you really want to consider updating to 3.x. Or at least 2.5. Otherwise, you're probably going to run into more and more problems like this (with out-of-date plugins, Gant being deprecated, etc.) as time goes on.
 

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/3ef34586-cd41-4605-8539-a267617bd6b4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mohammad Ali

未读,
2016年1月4日 23:23:102016/1/4
收件人 Geb User Mailing List
Don't worry, an upgrade to latest grails is in the pipeline :) . I'm putting it off because I have been asked to make some small changes to a legacy application which uses the same version of grails. Unfortunately there are next to no tests and I want to make sure I have a reliable development and test workflow setup.

For anyone interested, I have posted the example project on GitHub

回复全部
回复作者
转发
0 个新帖子