-
Notifications
You must be signed in to change notification settings - Fork 2.3k
.clear() seems not clearing when the cursor is in front of the text #4790
Comments
Do you have See here for more detail: https://w3c.github.io/webdriver/webdriver-spec.html#dfn-clear-algorithm |
@awarecan I updated my post. I don't have neither |
Since you have a such powerful inputmask element on above your input, I would suggest you interactive with inputmask instead input.
|
Does protractor allow elements other than
I tried it and it gives me error: |
@awarecan
Thanks you much |
The backspace doesn't work all the time; it definitely helps, but some of the inputs still fail. |
This work for me:
|
@rgurgul |
Hi there!
I'm not sure if this a bug or intended, please confirm it.
8.11.1
5.1.2
5.1.0
Chrome
macOS 10.13.2
In my case, I have a html
input
element with its cursor in front of the text. I'm able to dosendKeys()
with no problems, butclear()
seems not clearing anything. If I do the same thing with otherinput
elements whose cursors are in the end of their text, everything works fine. My code sample is something like this:this.zip
is theinput
element with cursor in front of its textAnd I also notice if I do a
click()
beforeclear()
. It does clear the text, butsendKeys(input)
would put text back.so for example:
if the original text in
zip
is12345
, andinput
is6789
, after the above execution, it would show678912345
. I putbrowser.sleep(2000)
in between each method and I can see in the browser, it clear thezip
field, and when it doessendKeys(input)
, it puts6789
in, but for some reason,12345
comes back.From what I understanding, the
clear()
function should clear the text regardless of the cursor position. Can someone explain the trick behind it?EDIT:
One thing I forgot to mention, the input element
zip
is a sub-element ofp-inputmask
, which is from PRIMENG.Here is what it looks like in Chrome.
Thanks
The text was updated successfully, but these errors were encountered: