clearValue is not clearing the value

763 views
Skip to first unread message

Negar Negaru

unread,
Jun 23, 2015, 9:08:11 PM6/23/15
to nightw...@googlegroups.com
Hello, I have a box with a text value inside. So I want to call it using

.clearValue(element.durInput)

but it's not clearing the value and so when I use .setValue it appends the new value instead of replacing. I wanted to instead use the code for keypress to press ctrl-a and then backspace to clear it. I'm using the code

browser.keys([browser.Keys.CONTROL, "a"])
browser.keys("8")

but I'm sure it's wrong since it's not working. Any idea how to make it work? Thanks in advance

Andrei Rusu

unread,
Jun 24, 2015, 4:42:30 AM6/24/15
to nightw...@googlegroups.com, negar...@gmail.com
You can try this to select the text:

browser.setValue(element.durInput, [browser.Keys.CONTROL,'a'])

Negar Negaru

unread,
Jun 24, 2015, 9:41:36 PM6/24/15
to nightw...@googlegroups.com, negar...@gmail.com
I tried it with no luck. I think the problem is with the website. Thanks for the hint regardless.

Emily Deakins

unread,
Sep 28, 2015, 10:13:10 AM9/28/15
to NightwatchJs
.clearValue does not work for me in Firefox (works flawlessly in Chrome). 

Also, using "browser.setValue(element.durInput, [browser.Keys.CONTROL,'a'])" does not work either. WebStorm complains about not recognizing "CONTROL".

Any ideas what could be causing Firefox to act up?

Balc

unread,
Nov 2, 2016, 2:42:54 PM11/2/16
to NightwatchJs
Any update on this, I also have the same issue, in my case its working without any issue in Firefox and chrome, but failing in IE11 
Reply all
Reply to author
Forward
0 new messages