Skip to content

[REGRESSION]: migrating from locator.type to locator.fill is a breaking change #28920

Description

@bel0v

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions