黄瓜/水豚与硒? [英] Cucumber/Capybara vs Selenium?

查看:17
本文介绍了黄瓜/水豚与硒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前几天,我向我公司的一位测试人员展示了我用 Cucumber 编写的一些测试(2 个功能,5 个场景).然后他问了我一个我无法回答的问题:

The other day I was showing one of the testers at my company some tests I had written in cucumber (2 features, 5 scenarios). Then he asked me question that I could not answer:

这比 selenium 或任何其他功能测试记录工具好在哪里?

How is this better than selenium or any other functionality test recording tool?

我知道 Cucumber 是一种不同的技术,它被置于不同的测试级别,但我不明白我为什么要费心编写和维护 Cucumber/Capybara 测试.

I understand that cucumber is a different technology and it's placed at a different level of testing, but I can't understand why I should bother to write and maintain Cucumber/Capybara tests.

谁能给我一个合理的解释,让我使用 Cucumber/Capybara 而不是仅仅使用 Selenium?

Can someone give me a reasonable explanation for using Cucumber/Capybara instead of just Selenium?

推荐答案

这个问题是征求意见的边界.你的问题实际上读给我看,什么工具适合我?"我这样说是因为你没有给出选择 Cucumber 和 Capybara 的理由.我相信要回答那个测试人员的问题,您需要先回答几个问题:

This question is borderline asking for an opinion. Your question actually reads to me, "What tool is right for me?" I say this because you don't give a reason for why you chose Cucumber and Capybara. I believe to answer that tester's question, you need to answer a couple more questions first:

1.) 您将在流程的哪个阶段编写这些测试?

1.) What stage in the process are you going to be writing these tests?

Cucumber 可能不是单元测试的正确选择,具体取决于您使用的语言.但它可以用于任何级别的测试,从单元到集成再到最终用户.

Cucumber may not be the right choice for unit tests, depending on the language you're using. But it can be used for any level of testing, from unit to integration to end-user.

2.) 谁来维护您的测试?你?其他开发商?测试人员?商业分析师?项目经理?

2.) Who is going to maintaining your tests? You? Other developers? Testers? Business Analysts? Project Managers?

必须维护自动化测试,并且知道谁会做这可以帮助您决定工具 - 因为有些对于某些用户来说过于技术性.

Automated tests must be maintained, and knowing who will be doing that can help you decide on a tool - as some will be too technical for certain users.

3.) 谁将定义新的测试?

3.) Who is going to be defining new tests?

Cucumber 旨在供开发人员、质量检查人员和业务所有者之间协作使用.它是将每个人的知识用于自动化测试过程的完美工具.然而,它需要开发一种无处不在的语言才能生效.您可以在 James Shore 的敏捷艺术 页面上阅读该内容.

Cucumber is meant to be used collaboratively between development, QA and business owners. It is the perfect tool for leveraging everyone's knowledge into the automated testing process. It requires the development of an ubiquitous language to be effect however. You can read up on that on James Shore's Art of Agile page.

回答完这些问题后,您就可以回答测试人员的问题了.

Once you've answered these questions, you're ready to address the tester's question.

但是,在比较记录工具(例如 Selenium IDE、HP Quick Test Pro、IBM Rational Functional Tester)与开发工具(nUnit、jUnit、RSpec、Selenium webdriver、Capybara) 是它们针对不同的受众.它们也有不同的优点和缺点.

However, there are a couple of points to keep in mind when comparing recording tools (such as Selenium IDE, HP Quick Test Pro, IBM Rational Functional Tester) vs. development tools (nUnit, jUnit, RSpec, Selenium webdriver, Capybara) is that they are targeted towards different audiences. They also have different plusses and minuses.

任何人都可以轻松使用录制工具,但它们创建的脚本很脆弱.它们很容易断裂,需要更多的维护.它们非常适合一次性自动化测试,您需要快速完成并拥有非技术人力.

Recording tools are easy for anyone to use, but the scripts they create are fragile. They break easily and require more maintenance. They are great for one-off automated testing, where you need to get it done quickly and have non-technical manpower.

开发工具的学习曲线较大,需要编程(或至少是脚本)经验.脚本通常更健壮,但需要更多的技术知识来维护.当您需要可重复性并计划长期使用测试时,它们是一个很好的解决方案.

Development tools have a larger learning curve and require programming (or at the least scripting) experience. The scripts are generally more robust, but require more technical knowledge to maintain. They are a good solution when you want repeatability and plan to use tests for a long time.

我强烈建议您阅读黄瓜书.它将真正帮助您确定 Cucumber 是否适合您.

I strongly suggest you read The Cucumber Book. It will really help you decide if Cucumber is the right choice for you.

这篇关于黄瓜/水豚与硒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆