locator.type() is marked as deprecated, with the suggestion In most cases, you should use locator.fill(value[, options]) instead.
.type focuses the input and puts in the text right next to the previous value.
.fill on the other hand clears up the input and fills it with new text, behaving like
await locator.clear()
await locator.type()
We have been using .type in our tests and thanks to that, found a bug in our codebase related to unwanted input. We would not have found it with using .fill — and thus not sure we should migrate to a less informative method.
locator.type()is marked as deprecated, with the suggestionIn most cases, you should use locator.fill(value[, options]) instead..typefocuses the input and puts in the text right next to the previous value..fillon the other hand clears up the input and fills it with new text, behaving likeWe have been using
.typein our tests and thanks to that, found a bug in our codebase related to unwanted input. We would not have found it with using.fill— and thus not sure we should migrate to a less informative method.