8000 MissingMethodException in 0.13.0 when setting input field value with value() · Issue #422 · geb/issues · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
MissingMethodException in 0.13.0 when setting input field value with value() #422
Closed
@craigatk

Description

@craigatk

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.

|  groovy.lang.MissingMethodException: No signature of method: java.util.HashMap$Values.minus() is applicable for argument types: (java.util.ArrayList) values: [[input, select, textarea]]
Possible solutions: min(), min(groovy.lang.Closure), min(java.util.Comparator), find(), find(), unique()
    at geb.navigator.NonEmptyNavigator.setInputValues(NonEmptyNavigator.groovy:704)
    at geb.navigator.NonEmptyNavigator.value(NonEmptyNavigator.groovy:448)
    at geb.content.TemplateDerivedPageContent.value(TemplateDerivedPageContent.groovy:33)

NonEmptyNavigator.groovy line 704 is

def unsupportedElements = inputsToTagNames.values() - ELEMENTS_WITH_MUTABLE_VALUE

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0