Skip to content

[Feature] publish _selector attribute of Locator and internal: selectors #23992

Description

@Snooz82

Hi (this is René from Robot Framework)

Introduction

i am one of the developers of Robot Framework Browser; the Playwright (node.js) based keyword library that is really gaining more users.
We have currently ~10% of the download numbers that Playwright Python has. (~90.000 / month)

I am writing that issue to create awareness and also request that a set of features that we depend on shall not be dropped. And some other maybe published to public api.

Robot Framework Browser is, because it is Keyword-Driven, imperative/procedural. That means we are calling functions like Click or Type Text with a selector as its first argument.

Therefore it is vital for us that the string based creation of Locator objects stays active.
Please never deprecate stuff like page.locator("div.some >> text='hello'");

Feature Request 1: _selector

Furthermore it would be nice to publish the locator._selector attribute as part of the public API.

We have keywords like Get Elements which return a handle to a Locator object that we store on the node side of our library. It would be better for many use cases to return the selector string in these cases.

Having that as part of the public API would give us more safety that we can rely on this.

Feature Request 2: internal:

the "new" getByRole or getByLabel etc. functions are interesting and are demanded by our users. We know that these are internally translated to selector strings and we would really like to use these selector strings officially as well.

therefore it would be awesome if you could publish the internal selectors as well.

page.getByRole("heading", { "name": "Login" });

Is equivalent to

page.locator('internal:role=heading[name="Login"i])

would be nice, if we could get in touch and discuss our usage of Playwright as well.

cheers
René

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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