TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

20 点作者 mesadb将近 3 年前
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&#x2F;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?

9 条评论

jmll将近 3 年前
In my (admittedly limited) experience, the difficulty of working with Selenium doesn&#x27;t stem so much from finding appropriate selectors but from britleness: network delays&#x2F;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&#x27;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 &quot;recording&quot; 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&#x2F;errors are present.<p>This is tricky and time consuming even when done manually, so I&#x27;m not sure it can be AI-mplemented. But that&#x27;s maybe an idea to explore down the line :)
评论 #31706654 未加载
评论 #31706350 未加载
speps将近 3 年前
POM = Page Object Model[1]<p>[1] <a href="https:&#x2F;&#x2F;www.browserstack.com&#x2F;guide&#x2F;page-object-model-in-selenium" rel="nofollow">https:&#x2F;&#x2F;www.browserstack.com&#x2F;guide&#x2F;page-object-model-in-sele...</a>
评论 #31706352 未加载
lloydatkinson将近 3 年前
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.
评论 #31708400 未加载
评论 #31721055 未加载
glmeece将近 3 年前
As an SDET, I&#x27;m always looking for quicker&#x2F;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&#x27;s neither brittle nor a mile long. This is something I&#x27;ve learned to do by hand, but optimizing as I&#x27;ve indicated doesn&#x27;t seem to be a part of the tools I&#x27;ve seen.<p>Also of note: Selenium was really designed for &quot;Web 1.x&quot; and doesn&#x27;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&#x27;s &quot;best of breed&quot;) vs. Selenium.
dzhar11将近 3 年前
A long time ago, I worked on my Page Object Generator pet project, a desktop app allowing me to record&#x2F;test page elements via Selenium Webdriver. <a href="https:&#x2F;&#x2F;github.com&#x2F;dzharii&#x2F;swd-recorder" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dzharii&#x2F;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&#x2F;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.
评论 #31721121 未加载
notadev将近 3 年前
I would absolutely pay for this, but only if it could work with web applications built in React. React generates CSS class&#x2F;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.
jitl将近 3 年前
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.
评论 #31706657 未加载
评论 #31711372 未加载
sattoshi将近 3 年前
Sounds somewhat similar to Dakka: <a href="https:&#x2F;&#x2F;www.dakka.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.dakka.dev&#x2F;</a>
评论 #31721141 未加载
shyn3将近 3 年前
Get DataDog. Launch their synthetic ux monitor.<p>Implement that for scraping and that would be great I think.
评论 #31721131 未加载