Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Generate Dynamic XPaths Using Axis Mechanism in Codegen: #34111

Open
Rahimtulla opened this issue Dec 20, 2024 · 1 comment
Open

Comments

@Rahimtulla
Copy link

🚀 Feature Request

Currently, the XPaths generated by codegen are often basic and static. It would be highly beneficial if codegen could generate dynamic and optimized XPaths that leverage Axis Mechanisms (e.g., following-sibling, parent, ancestor, etc.) for improved reliability and maintainability in automated scripts.

Example

No response

Motivation

In its current implementation, the XPaths generated by codegen tend to be basic and static, which can lead to challenges in maintaining test scripts. Static XPaths often fail when there are minor UI changes, requiring frequent updates to the automation scripts.

By generating dynamic and optimized XPaths using Axis Mechanisms (e.g., following-sibling, parent, ancestor), the framework can significantly enhance the reliability of selectors. Such XPaths are inherently more robust, as they rely on logical relationships within the DOM structure rather than absolute positions or simplistic identifiers.

This improvement would not only reduce the time spent on maintaining flaky tests but also help teams focus more on building scalable test suites. Dynamic XPaths aligned with best practices will empower automation engineers to work more efficiently and deliver better-quality outcomes.

@pavelfeldman
Copy link
Member

It is unlikely that we invest in XPath as it is strongly discouraged. When does Playwright generate those for you? It should offer them as last recort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants