Feedback request for Geb 1.0-rc-1

97 views
Skip to first unread message

Marcin Erdmann

unread,
Oct 2, 2016, 3:04:12 PM10/2/16
to Geb User Mailing List
Hi everybody,

Geb 1.0-rc-1 has been published almost a week ago. So far no issues have been reported but I would like to make sure that this is because none have been found by you, the users, and not because nobody tried it. The target is to release 1.0 final next weekend if no blocking issues are reported.

Can people who updated their projects to use Geb 1.0-rc-1 either successfully or not please speak out?

Thanks,
Marcin Erdmann

Brian Westrich

unread,
Oct 3, 2016, 10:03:14 AM10/3/16
to Geb User Mailing List
Marcin,

Thank you for releasing the new version of geb. 

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. 

Craig Atkinson

unread,
Oct 3, 2016, 11:22:27 AM10/3/16
to geb-...@googlegroups.com
Hi Marcin,

Just wanted to report that I've been running Geb 1.0-rc-1 on my apps since the release and haven't had any issues.

Thanks,
Craig

--
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+unsubscribe@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/CA%2B52dQRcmmWb%2B86G88fHQM%2BobGb_gu256WE_wR%3Dhc5CbPgcF%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Brian Kotek

unread,
Oct 3, 2016, 11:40:16 AM10/3/16
to Geb User Mailing List
Hmm...if older versions of Geb handled this, I'd say that is probably a bug, rather than the behavior you're seeing. Trying to click on two elements at once is something I'd expect to fail, because it means uncertainty about what is actually happening. Will it click the first element? The last one? Loop over them and click them both? I think the right thing to do would be to use a more specific selector, so that you're positive about what's going to be clicked 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+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.

Brian Westrich

unread,
Oct 3, 2016, 1:22:49 PM10/3/16
to geb-...@googlegroups.com
Brian,

Good point. 

The selector I'm using is ....
saveButton { $('button[id=save-button]') }
which is specific enough, but our app had two buttons on the page that used this same ID (a "no-no"). Once we corrected this the geb test passed. Glad to see that geb 1-rc-1 caught this!

Brian 

On Mon, Oct 3, 2016 at 10:39 AM, Brian Kotek <bria...@gmail.com> wrote:
Hmm...if older versions of Geb handled this, I'd say that is probably a bug, rather than the behavior you're seeing. Trying to click on two elements at once is something I'd expect to fail, because it means uncertainty about what is actually happening. Will it click the first element? The last one? Loop over them and click them both? I think the right thing to do would be to use a more specific selector, so that you're positive about what's going to be clicked on?   

Marcin Erdmann

unread,
Oct 3, 2016, 5:07:28 PM10/3/16
to Geb User Mailing List
Thanks for reporting back, Craig!

Marcin Erdmann

unread,
Oct 3, 2016, 5:18:27 PM10/3/16
to Geb User Mailing List
Hi Brian,

As you've probably realised by now, the failure you got was intended and has to do with issue #284 (https://github.com/geb/issues/issues/284).

Previously there was a lot of methods on Navigator which silently dealt only with the first element of the Navigator if it contained multiple elements. This could lead to subtle bugs where you were not aware that you are dealing with a multi element Navigator as in your case. This behaviour has been changed for 0.13.0 and calling such methods on a multi element navigator now throws the exception you got. I hope that this leads to better error reporting. Note that you are still able to call these methods on all elements of a Navigator if you do so explicitly by using the spread operator (*.).

I hope that the exception message you experience is self explanatory and good enough to understand what the problem is. Let me know if you believe it could be improved.

Cheers,
Marcin 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.

Brian Westrich

unread,
Oct 3, 2016, 5:29:18 PM10/3/16
to geb-...@googlegroups.com
Hi Marcin,

After fixing the 'multiple navigator' issue (in my app) that we just discussed, and also updating my tests to use the new syntax for modules that was introduced in version 0.12.0, I'm not seeing any issues with geb version 1.0-rc-1. 

Brian 

Marcin Erdmann

unread,
Oct 3, 2016, 5:43:31 PM10/3/16
to Geb User Mailing List
Thanks for reporting back, Brian!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages