IridiumApplicationTesting icon indicating copy to clipboard operation
IridiumApplicationTesting copied to clipboard

Unable to clear selects - Element must be user-editable in order to clear it.

Open maraisr opened this issue 7 years ago • 1 comments

Running the following step fails when targeting selects

And I clear the element by "#my-select"

Error produced: Element must be user-editable in order to clear it.

maraisr avatar Nov 21 '18 00:11 maraisr

Hi @maraisr, Nice to meet you here :) How are you? Hope everything goes well.

In selenium (https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html), webElement.clear() is only applied to the text entry element. Now, Iridium is calling this to clear the text input field.

For the select/drop-down list, my understanding is the default value or blank value could be set to any one of the options for that select by the developers for certain fields. We could not guarantee that the first option is always the blank one. So, webdriver has no idea which option should be selected as the blank value. Maybe, when we are going to clear the select field, we could use 'And I select "Option with blank value" from the "selectList" drop down list', or 'And I select "Option with default value" from the "selectList" drop down list'

Not sure whether the info above could be helpful.

dehanw avatar Nov 21 '18 22:11 dehanw