-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingMethodException in 0.13.0 when setting input field value with value() #422
Comments
I'll try to reproduce the exception with a test in Geb core and if I can I'll submit a PR to fix it. |
I haven't been able to reproduce the issue in a test inside Geb core yet, but I was able to reproduce it in a public Grails2 project: https://github.com/craigatk/geb-example |
I think I know why I'm getting this exception in my Grails2 apps but can't recreate in Geb core - different Groovy versions. I added a test to the geb-grails plugin that calls .value() and messed around with specifying different Groovy versions in geb-grails.gradle. Currently project.groovyVersion is in there, which is 2.4.5. When I changed the Groovy version to what ships with Grails 2.4.2 (Groovy 2.3.7), then I got the exception. I tried some different versions and any Groovy version >= 2.4.0 works fine so they must have added more methods for that HashMap.Values class in Groovy 2.4.0 Now that I have a way to reproduce and test the fix I will work on a PR to fix it to work with Groovy < 2.4 |
Thanks for reporting and looking into this, @craigatk. I'm a bit busy tonight and tomorrow so I might not be able to attend to it before Friday, sorry about that. Looking forward to the PR, though. |
@erdi no problem, looking into it by the weekend is still quick! :) I created a PR with a fix here apache/groovy-geb#115 If there's anything I should change in the PR or do differently, just let me know. Thanks! |
That was quick, thanks. I will comment on the PR. |
I get this exception when trying to set an input field's value with the .value() method in a company project I'm working on. I tried to reproduce the issue in a public project to give a reproducible example but it works fine in the public project, which is inconvenient.
NonEmptyNavigator.groovy line 704 is
link https://github.com/geb/geb/blob/0a2f45c9b70da018597f0847e230363be20e8bc0/module/geb-core/src/main/groovy/geb/navigator/NonEmptyNavigator.groovy#L704
In the past I've been bitten by HashMap.values() not being a normal collection type (List, Set, etc.) - it's a special class Values inside HashMap that doesn't have all the same collection methods as some of the more common collection classes.
From looking at what methods the Values class does have, it looks like it has the removeAll() method which could be a good substitute in this case.
The text was updated successfully, but these errors were encountered: