Live data from Hacker News

Ask HN: Would you be interested in POM generator for Selenium?

news.ycombinator.com

21–30 of 35 posts

Re: Ask HN: Would you be interested in POM generator for Selenium?

#22
post #17
post #15

Earlier 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.

Quite literally every Selenium test I’ve had access to has been a total disaster. When your build pipelines fail 50/50 because of some bullshit Selenium timeout no one can reproduce that resolves itself the next run, it’s time to look at another tool. Not to mention that the Selenium port for .NET is a literal verbatim translation from Java and written by people clearly not versed in C#. The API and way the library works are nothing like how you’d expect a C# library to work.

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?

#23
post #4

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.

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.

Re: Ask HN: Would you be interested in POM generator for Selenium?

#24
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.

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.

Re: Ask HN: Would you be interested in POM generator for Selenium?

#26
post #3

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). 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 .

This is actually very interesting. I like how it's done. Very great job.

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?

#27
post #11
post #6

Earlier quoted context omitted.

Why would someone not spell that out in the title, I wonder.

I'm wondering why people would want the Project Object Model for Java.

Sorry, I didn't want to make the title too long.

I think there still too many companies using Java and Selenium. No?

Re: Ask HN: Would you be interested in POM generator for Selenium?

#28
post #5
post #3

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). 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 actually do observe the DOM and we should expect new objects on the page.

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?

#29

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.

Hi, we actually have done this for Cypress. I'd love to get your feedback on it: https://cypress.preflight.com/

Re: Ask HN: Would you be interested in POM generator for Selenium?

#30
post #23

Earlier 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.

I really like playwright's locators as well. It looks pretty cool. We actually have a Cypress POM generator tool which uses AI and let's you test emails etc: https://cypress.preflight.com/
Post reply on HN