Ask HN: Would you be interested in POM generator for Selenium?
I have some plans to implement a POM and script generator for Selenium which includes multiples selectors and uses some AI selectors.
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
Some other benefits might come with it is Email and PDF testing for Selenium.
Curious what you think about this?
34 comments
[ 6.0 ms ] story [ 82.0 ms ] thread[1] https://www.browserstack.com/guide/page-object-model-in-sele...
I think there still too many companies using Java and Selenium. No?
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.
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.
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 :)
[0] https://developer.mozilla.org/en-US/docs/Web/API/MutationObs...
We do this on a different side of our product which we try to come up with test coverage from how your users use your app.
We also do the same thing but we also understand the box (context) then we can say. We should be on Sign in box and a button called Sign in should be present. If we are on a different page and we cannot find something similar to it, we will give better error messages. Like: we should have been on Sign in page but we are on sign up. etc.
Would love to learn from your experiences on any better frameworks you might have used, though!
It’s as if you would test your app with curl, very fast and reliable. On the other hand, contrary to Selenium, there is no Javascript engine so you can only test the “raw” DOM or json response sent by the network (and not a DOM managed and rendered by a Javascript front end framework).
(Disclaimer: I’m one of Hurl maintainer)
[1]: https://hurl.dev
API/request level testing is great when appropriate, but testing what happens in browser won't be possible without using something like selenium, nightwatch or playwright
On the other hand, you can also easily test use cases where the browser is “helping” you (for instance, you want to test that your backend didn’t accept an invalid email, but your HTML form has HTML5 validation that prevents a user to enter an invalid email). Or you want to test HttpsOnly cookie attributes. But it can’t do UI integration tests.
Would love to get your feedback so we can add it :)
I still think any E2E test tooling will have the same issues and be simply horrible.
For example class properties are not meant to do expensive work and yet they directly interface with the IPC to the browser. This means debugging in Visual Studio becomes impossible in any meaningful way. Hovering over a property while paused on a breakpoint will trigger some command in the browser that might throw an exception which causes an exception in the debugger.
Playwright, Cypress, Web Driver are simply what should be considered the defaults in 2022.
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'll drop you an email when we are able to launch it. Would love to get your feedback
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.
Implement that for scraping and that would be great I think.