[Feature] Add locator.clear() for input fields
See original GitHub issueI would like to request a locator.clear()
functionality (similar to the one found in other frameworks) to empty the content of input fields (shouldn’t be limited to input
and textarea
elements though since elements don’t always follow these conventions).
Unfortunately, the workaround of using locator.fill('')
doesn’t work reliably, it doesn’t change the content of some input fields at all.
Issue Analytics
- State:
- Created a year ago
- Reactions:13
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How to clear() input fields in web? - Katalon Community
1.- Add a new “Web UI Keyword” · 2.- Choose the keyword “Send Keys” · 3.- Doubleclick on the object column and find...
Read more >Clear input fields on form submit - javascript - Stack Overflow
I'd like to simply have the two input fields in my page to clear when I click submit (&& enter - unless its...
Read more >Handling different types of inputs | Playwright with Typescript ...
Handling different types of inputs :In this video, we are going to learn how to handle different types of input fields.
Read more >How To Clear Input Field on Focus - W3Schools
Learn how to clear an input field on focus. Click on the input field to clear it: Clear Input Field on Focus. Example....
Read more >Add, copy, or remove a text box in Word - Microsoft Support
Select a location and press Ctrl+V to paste the text box. Delete a text box. Select the border of the text box that...
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 Free
Top 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
I agree there, fill(‘’) is not very idiomatic!
Im up for this one as well
await page.fill(‘[data-testid=“input-name”] input’, ‘Slim Shady’); await page.fill(‘[data-testid=“input-name”] input’, ‘’); await page.fill(‘[data-testid=“input-name”] input’, ‘Dr Dre’);
This doesnt sit right.