Skip to content

[Feature] Possibility to configure parameter for code creation through recording #1227

Open
@morepe

Description

@morepe

With playwright version 1.27.0 the code that is created through recording has changed completely.
See below the same flow recorded with a recent version and with 1.26.0:
grafik

Previously we consistently got "page.locator" entries, now we get a mixture of "page.getBy"... and "page.locator" entries. Additionally we get some entries that are very difficult to read:

difficult_to_read

So in the current version the recording is not usable to us, as it would create inconsistent selectors. What we are prefering in our project are selectors identify by text and chain back/forward to other text like this:

wanted_selector

As every project has different preferences I suggest of introduce a configuration possibilities on created code where you could specfiy things like: "always use the attribute id unless there is a text on the element".

Some ideas for configuration possibilities:

  • Use attribute "xy"
  • Prefer CSS selectors
  • Prefer Labels selectors
  • Prefer ARIA roles

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions