I'm setting up a geb automation front-end test which requires me to clear the input values and set new values. I use WebElement clear method but it works for some input element but doesn't for some.
I use following code as a work around which may be a poor hack
def length = InputElement.value().toString().length()
while(length-- > 0){
InputElement.firstElement().sendKeys(Keys.BACK_SPACE)
}
Is there any better way to achieve the same functionality?
You should be able to set the input.value = ""