I have some plans to implement a POM and script generator for Selenium which includes multiples selectors and uses some AI selectors.<p>It will work this way:
- Go to the page you want the POM for
- Open the chrome extension
- Click on generate POM
- We will generate POM
- You can add/remove some sections<p>Some other benefits might come with it is Email and PDF testing for Selenium.<p>Curious what you think about this?
In my (admittedly limited) experience, the difficulty of working with Selenium doesn't stem so much from finding appropriate selectors but from britleness: network delays/timeouts, objects not yet being yet lodaded into the DOM, dynamically generated classnames (think scraping obfuscation).<p>I do see a niche for an system (AI or not) that deals with that last case (i.e. it automatically grabs some correlated selectors to fallback to), or as a quick tool to scrape static sites.<p>However (and this may be out of your proposed scope, and that's fine) I see more value on something that can construct a sort of DOM timeline - in order to accurately know what is available and when. If you start "recording" network and user events since page load, you may be able to reconstruct a) which nodes the user interacted with b) which preconditions there are for these nodes to be consistently available, no matter which stochastic delays/errors are present.<p>This is tricky and time consuming even when done manually, so I'm not sure it can be AI-mplemented. But that's maybe an idea to explore down the line :)
For selenium? No absolutely not in fact I would happily pay someone to not add to the horror that is selenium. I would however be interested in a POM generator for Cypress or Web Driver.
As an SDET, I'm always looking for quicker/easier ways to get selectors that are non-brittle. The trick is to analyze either the CSS or XPath selector and optimize it so it's neither brittle nor a mile long. This is something I've learned to do by hand, but optimizing as I've indicated doesn't seem to be a part of the tools I've seen.<p>Also of note: Selenium was really designed for "Web 1.x" and doesn't assume the dynamic DOMs of today. Modern frameworks like Playwright are built with the understanding that the DOM is dynamic and are more robust. So - consider Playwright (or something like it - although I think it's "best of breed") vs. Selenium.
A long time ago, I worked on my Page Object Generator pet project, a desktop app allowing me to record/test page elements via Selenium Webdriver.
<a href="https://github.com/dzharii/swd-recorder" rel="nofollow">https://github.com/dzharii/swd-recorder</a><p>It was a time when I had to test an IE6-only enterprise web tool, And there was no option to copy CSS-selector in Chrome/Firefox.
I am not working in UI automation anymore (sad :( ) and lost interest in this project, but I think having a tool to record page objects and generate some smart automation code can still be quite helpful.
I would absolutely pay for this, but only if it could work with web applications built in React. React generates CSS class/ID names, some of which are duplicates. This requires determining convoluted XPATHs which can very easily, and often do, change in ways that immediately break the pre-defined locators. I’m aware of using unique attributes to make elements easier to locate, but that often requires someone else’s buy-in which isn’t always a guarantee. Even having a way to run the application in a headless browser and generating the POM programmatically would be great.
Given that I don’t know what this is, and that Selenium’s API is well-known to promote flakey tests (it’s flakey by default and needs layers of abstractions to add waits, delays, etc), I’d stay away.