Playwright · Junior · Question 25 of 75
Which method types text into an input, replacing its value?
- 1
fill() - 2
setValue() - 3
write()
Show the answer
Correct answer: fill()
Explanation
fill() focuses the field, clears it and sets the new value in one step, firing an input event. It works for inputs, textareas and contenteditable elements.