WebDriverException Element must be user-editable in order to clear it
Asked Answered
D

4

10

I am trying to run test cases to perform reset password and I am facing this issue.

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

Basically i am accessing the page for entering the new password and doing this:

browser.$("#newPassword").text("password");

where execution of the above line throws the error.

Dunston answered 25/2, 2015 at 5:40 Comment(5)
can you share the code you are using and the url of the page you are testing ? There are workarounds already tried for such exception as #15360862 or here #25290598Eboat
Well what kind of element is it? An input?Crankcase
Yes it is an input element of type passwordDunston
Hi, The issue got solved. The issue was because i had two ids in same name and it took the first id which was not an editable element. Thanks for the responseDunston
Hi, I am getting the same error on type button element i.e., .setValue('div#newOrUsed>button', 'New')Slipway
I
33

I had the same problem and it was because there was another element with the same id which was not an input field so it could not be cleared.

Idolatry answered 14/7, 2016 at 13:22 Comment(1)
Kinda the same for me, i had a bad xpath expression. This put me on the right track though, thanks.Efflorescent
H
2

We can try the following:

WebElement.sendKeys(Keys.DELETE);
WebElement.sendKeys("Test");
Hartebeest answered 14/9, 2016 at 9:50 Comment(0)
L
1

It might be a case of using the wrong method for the input type.

In CodeCeption at least, fillField should be used on input elements and selectOption should be used on select elements and mixing them up will give invalid element state: Element must be user-editable in order to clear it.

Letitialetizia answered 12/11, 2018 at 6:20 Comment(0)
U
0

I had this problem with a Primefaces autoComplete element. Primefaces 6.0 renders a span with the ID you pass, and within that an input with a "_input" appended to the ID. If you just use the ID you added in your source code, you tell Selenium to enter into the span (which fails with the "element must be user-editable" error). Add the "_input" to the ID if you select by ID in selenium.

Ursuline answered 23/10, 2017 at 19:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.