Live data from Hacker News

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

news.ycombinator.com

1–10 of 35 posts

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

#1
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?

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

#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 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 :)

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

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

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

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

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

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

Aren't all E2E test frameworks flaky by default? When you're testing the end user experience that goes through multiple layers of services, I think that should be expected.

Would love to learn from your experiences on any better frameworks you might have used, though!

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

#10
post #9
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.

Aren't all E2E test frameworks flaky by default? When you're testing the end user experience that goes through multiple layers of services, I think that should be expected. Would love to learn from your experiences on any better frameworks you might have used, though!

We’re using Hurl [1] at work for integration tests with very good success. We’ve eliminated false positive or flacky tests: it’s a simple tool that runs HTTP requests and you can add asserts on responses.

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

Post reply on HN