Enter does not clear the current value of the field
See original GitHub issueBelow a small output part of a test. I am trying to change the value of the field Achternaam, but I can’t get it cleared.
|script | browser test|
|ensure | is visible | Achternaam|
|check | value of | id=aanvrager1.achternaam | Vriez|
|enter | Iets anders | as | id=aanvrager1.achternaam|
|check | value of | id=aanvrager1.achternaam | [VriezIets anders] expected [Iets anders]|
Can anyone explain why the enter command is not clearing the value of the field first? I really have no clue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How To Clear Input Field on Focus - W3Schools
Click on the input field to clear it: Clear Input Field on Focus. Example. <!-- When the input field gets focus, replace its...
Read more >HTML | Clearing the input field - GeeksforGeeks
To clear the entire input field without having to delete the whole thing ... input present in the input field, that the user...
Read more >HTML how to clear input using javascript? - Stack Overflow
CODE EXPLAINED: When the text box has focus, clear the value. When text box is not focused AND when the box is blank,...
Read more >Clear Input fields after Submit using JavaScript | bobbyhadz
To clear an input field after submitting, add a `click` event listener to a button. When the button is clicked, set the input...
Read more >How to Clear Input Fields in JavaScript - Linux Hint
The “reset()” method clears all the values of the form elements. This method can be implemented to clear the input field holding text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try placing the following scenario above your script (or in your ScenarioLibrary page):
It empties the field by selecting its contents and sending a backspace keypress (instead of trying to use Selenium magic which sometimes fails with JavaScript) and then typing the value desired.
I’m guessing some javascript that is executed on focus of the input field is causing trouble
you could try clicking
id=aanvrager1.achternaam
before you enter the new value. If that works,it’s probably some async javascript you should wait for first.