When I change my geb version from 0.10.0 to 1.0-rc-1, I'm getting the following error in my geb tests when they attempt to click a button:
Method click() can only be called on single element navigators but it was called on a navigator with size 2. Please use the spread operator to call this method on all elements of this navigator or change the selector used to create this navigator to only match a single element.
If I pause test execution in the debugger, I can see that there are 2 context elements defined for the navigator. I also see 2 elements when using the older version of geb, though it seems to be able to handle this.
Here are the dependency related sections of my build.gradle file:
ext {
// The drivers we want to use
drivers = ["firefox" /*, "chrome", "phantomJs" */]
ext {
groovyVersion = '2.4.1'
gebVersion = '0.10.0'
// seleniumVersion = '2.43.1' // needed to work with phantom JS, per https://github.com/geb/geb-example-gradle/pull/19
seleniumVersion = '2.45.0'
// note: need to update from 2.43.1 to prevent firefox from hanging on startup with a 'server not found' error
chromeDriverVersion = '2.10'
phantomJsVersion = '1.9.7'
}
}...
dependencies {
// If using Spock, need to depend on geb-spock
testCompile "org.gebish:geb-spock:$gebVersion"
testCompile("org.spockframework:spock-core:1.0-groovy-2.4") {
exclude group: "org.codehaus.groovy"
}
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile "org.gebish:geb-junit4:$gebVersion"
// Drivers
testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testCompile("com.github.detro.ghostdriver:phantomjsdriver:1.1.0") {
// phantomjs driver pulls in a different selenium version
transitive = false
}
testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}
Let me know what other info would be useful to provide to troubleshoot this.