Ask HN: Would you be interested in POM generator for Selenium?
21–30 of 35 posts
Re: Ask HN: Would you be interested in POM generator for Selenium?
#22Earlier quoted context omitted.
So is really Cypress/Puppeteer/Playwright much more stable than Selenium. I still think any E2E test tooling will have the same issues and be simply horrible.
Yes, way more stable. At least cypress, I don't have much experience with playwright. We never had an issue regarding brittleness or stability. We do, however, get sometimes frustrated over certain API choices, like the way sessions and cookies are managed and how hard it is to keep a value throughout a test suite etc.
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.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#23Given 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.
Cypress completely solved flakey UI tests for me. I used Selenium for years but would never go back now.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#24Also 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.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#25Implement that for scraping and that would be great I think.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#26In 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). 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…
Regarding automatic selectors: check out my open source library https://github.com/mherrmann/selenium-python-helium .
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.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#27Re: Ask HN: Would you be interested in POM generator for Selenium?
#28In 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). 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…
The DOM timeline you describe would be pretty straightforward to create using a MutationObserver [0]. It's available in all major browsers. [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.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#29For 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.
Re: Ask HN: Would you be interested in POM generator for Selenium?
#30Earlier quoted context omitted.
Cypress completely solved flakey UI tests for me. I used Selenium for years but would never go back now.
Switched from Cypress to Selenium a while ago. It is noticeably quicker to respond to network request waits. Additionally, I prefer Playwright’s locator abstractions to Cypress’ queue/alias system.