Skip to content

Adding support forgetByLocator locator API #114

@krishhna123

Description

@krishhna123

Problem or motivation

Though different locator APIs are available like getByText(), getByRole(), getByTestId(), getByLabel(), I think there should be support for finding elements using xpath, id and classname.
I understand finding elements with these locators in not recommended but I think it will still work as a fallback strategy when no other strategies are useful.

Proposed solution

We should be able to retrieve element using getByLocator() API
e.g

getByLocator("//xapth-of-element")
getByLocator("#id-of-element")
getByLocator(".className-of-element")

Target platform

Both

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions