AutoGeneral / IridiumApplicationTesting

A&G Web Application Testing Suite
https://www.gitbook.com/book/autogeneral/iridiumapplicationtesting-gettingstartedguide/details
MIT License
20 stars 13 forks source link

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

Open maraisr opened 5 years ago

maraisr commented 5 years ago

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.

dehanw commented 5 years ago

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.