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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Are you doing automated UI testing – why or why not?

6 点作者 atiffany大约 10 年前
I have worked in several companies that have had goals of automated UI regression test suites, but I've never worked at a company that pulled it off successfully. I can name off a case-by-case list of reasons why these efforts have failed, but I am curious if the community is seeing similar trends.

4 条评论

atiffany大约 10 年前
I&#x27;ll add one example from a past company I worked for:<p>- We had a manager and one internal developer assigned part-time to an effort to seed an automation effort.<p>- The front-end of the application was Flex.<p>- Most QA analysts at the company had never written code before.<p>- We attempted to use Selenium.<p>As you can imagine, this was a crash and burn for several reasons. The company couldn&#x27;t get enough buy-in internally to dedicate more developer time to seed the effort, and the long-term approach was not well thought out. A few tests were deployed, but they were brittle because they relied on DOM elements. This was partially because QA analysts were expected to be able to use a Selenium &quot;capturing&quot; tool to create tests without writing any code.<p>Writing this out now, I think the root problem is that at the management level, the sentiment was just that we should &quot;do automation&quot; and no one really understood how much that would involve. There doesn&#x27;t seem to be any turn-key solution out there that is designed to fit in with the rest of a company&#x27;s development processes.<p>When there isn&#x27;t a clear path for solving a problem, it becomes a much more expensive problem to solve. In this case, the cost far out-weighed any benefit that the company would see.<p>With that said, I am still optimistic about the potential for effective UI automation testing and I&#x27;d love to hear more stories.
jfella5大约 10 年前
- We use selenium, test cases are written in python.<p>- We use the webdriver, recording never worked<p>- Followed the page model<p>- Had to build in retries on getting elements to make tests reliable<p>- You need upper management buy-in. Took us 8 months to start getting it right<p>- I would say our team members are intermediate with python<p>- Devs currently do not write tests. But they asked to start writing which is a good sign<p>- Yes some days you just spend fixing broken tests. But you get experience on how to write them better over time<p>Tips:<p>- Work with devs to get build the page with proper selectors (use ID if not, then us CSS selectors, don&#x27;t use xpath)<p>- Use APIs to seed data for your tests<p>- Get to the page you need to test as fast as possible by hitting the urls directly, using APIs to seed what data u need. Manually injecting cookies to get to the state you need.<p>Costs:<p>- 2 full time engineers only working on automation for 8 months.<p>- Once you have your framework in place writing tests become a lot easier
jags-v大约 10 年前
I think the question is incomplete(at least I think so).<p>Its not about automating the UI tests for regression testing,but to ensure that regression testing is effective.Most of the times,this is driven through the UI, which could be flaky.<p>As the test pyramid paradigm states , having a lot of UI tests, depending on the functionality &amp; complexity could be an anti pattern. Essentially , a lot of the functionality can be tested using by writing unit tests &amp; integration tests and the end to end business use cases should be automated through the UI just to ensure it works.<p>If it is possible to drive the state of the application using an API or URL, to the target state and then we assert elements to check the UI.<p>This enables faster feedback and is less flaky.This is how we approached testing in our team.Depending on the objective , we would use Selenium ,JUNit , Cucumber or corresponding ones in a given programming language.
jfella5大约 10 年前
Yes, I along with my team members have helped my company come from zero automation to decent coverage with UI tests. We have tests that run reliably for Web, iOS and Android.<p>It has certainly improved our deployment time.<p>If you describe some of the your problems. I can tell you how we overcome them.
评论 #9293672 未加载