自动化测试 单元测试 工具_10种最佳测试自动化工具

自动化测试 单元测试 工具

We all want to build maintainable tests for our web applications.

我们都希望为我们的Web应用程序构建可维护的测试。

As a part of this goal, we want to avoid losing sleep over implementation details and focus on making our tests give us the confidence for which they are intended.

作为此目标的一部分,我们希望避免因实施细节而睡不着,并专注于使我们的测试为我们提供预期的信心。

Those tests should be maintainable in the long run so regular changes don’t break them and slow our team down.

从长远来看,这些测试应该是可维护的,因此定期进行的更改不会破坏它们并使我们的团队慢下来。

Iteration Speed / Realistic Environment

迭代速度/现实环境

Some testing tools give you a short feedback loop between making a change and viewing the result, but don’t mimic the browser behavior precisely.

某些测试工具为您提供了一个在更改和查看结果之间的简短反馈循环,但并不能精确地模仿浏览器的行为。

Other tools might use a real browser environment, but reduce the iteration speed and may be flakier in a continuous integration system.

其他工具可能会使用实际的浏览器环境,但会降低迭代速度,并且在连续集成系统中可能会变得更加脆弱。

1.Selenium (1. Selenium)

Image for post

A well known framework for automating browsers and testing web applications.

用于自动化浏览器和测试Web应用程序的众所周知的框架。

The tests can be written in various programming languages, such as Java, C#, Ruby, JavaScript, R and Python.

测试可以用各种编程语言编写,例如Java,C#,Ruby,JavaScript,R和Python。

Selenium currently provides client APIs for each of those languages.

Selenium当前为每种语言提供客户端API。

Where possible, Selenium WebDriver uses native operating system level functionality rather than browser-based JavaScript commands to drive the browser.

Selenium WebDriver尽可能使用本机操作系统级别的功能,而不是基于浏览器JavaScript命令来驱动浏览器。

This bypasses problems with subtle differences between native and JavaScript commands, including security restrictions.

这绕过了本机命令和JavaScript命令之间的细微差别(包括安全性限制)的问题。

It offers a lot of flexibility and it even supports dealing with iframes and multiple browser tabs.

它提供了很大的灵活性,甚至还支持处理iframe和多个浏览器标签。

The cross-browser capabilities are impressive, since Selenium tests can be executed on all major browsers (Chrome, Firefox, Safari, Edge, Internet Explorer).

跨浏览器的功能令人印象深刻,因为可以在所有主要浏览器(Chrome,Firefox,Safari,Edge,Internet Explorer)上执行Selenium测试。

Selenium Grid can be used with the WebDriver to execute tests on remote systems.

Selenium Grid可以与WebDriver一起使用,以在远程系统上执行测试。

The only disadvantage of using Selenium is that it requires a considerable amount of skills and time to write tests.

使用Selenium的唯一缺点是,它需要大量的技能和时间来编写测试。

For someone who doesn’t have programming experience, it might seem easy at first to write tests with Selenium, but not applying good practices will lead to an internal test automation framework which is difficult to maintain and is not reliable.

对于没有编程经验的人来说,乍一看用Selenium编写测试似乎很容易,但是如果不应用良好实践,将导致内部测试自动化框架难以维护且不可靠。

Website: https://www.selenium.dev/

网站: https//www.selenium.dev/

2.结束测试 (2. Endtest)

Image for post

Endtest is best known as an Intelligent Test Automation solution.

Endtest是最著名的智能测试自动化解决方案。

It uses multiple open source and proprietary components to simplify the process of building and executing tests.

它使用多个开源和专有组件来简化构建和执行测试的过程。

One of those components is a Recorder which empowers users without any programming skills to build automated tests.

其中的一个组件是Recorder,它使用户无需任何编程技能即可构建自动化测试。

You can edit and manage your tests without writing any code, through a GUI.

您可以通过GUI编辑和管理测试,而无需编写任何代码。

It has the same level of flexibility as Selenium, allowing you to automate scenarios which involve iframes, multiple browser tabs, file uploads, Shadow DOM, etc.

它具有与Selenium相同的灵活性,可让您自动化涉及iframe,多个浏览器标签,文件上传,Shadow DOM等的方案。

It has the same cross-browser capabilities as Selenium, the tests can be executed on all major browsers (Chrome, Firefox, Safari, Edge, Internet Explorer).

它具有与Selenium相同的跨浏览器功能,可以在所有主要浏览器(Chrome,Firefox,Safari,Safari,Edge,Internet Explorer)上执行测试。

A cross-browser cloud grid is also included, which includes browsers on Windows, Mac machines and mobile devices.

还包括跨浏览器的云网格,其中包括Windows,Mac计算机和移动设备上的浏览器。

Additional components include the capability to execute pieces of JavaScript code, to send API requests and to connect to databases and execute SQL queries.

其他组件包括执行JavaScript代码,发送API请求以及连接数据库和执行SQL查询的功能。

These additional components can be used to add extra verification steps during your tests and to prepare or clean the test environments.

这些附加组件可用于在测试过程中添加额外的验证步骤,以及准备或清理测试环境。

Website: https://endtest.io

网站: https//endtest.io

3.瓦蒂尔 (3. Watir)

Image for post

An open source Ruby library for automating tests.

一个用于自动化测试的开源Ruby库。

Watir interacts with a browser the same way people do: clicking elements and filling out inputs.

Watir与人们进行浏览器交互的方式相同:单击元素并填写输入。

It actually uses Selenium under the hood, providing the same flexibility and cross-browser support.

它实际上是在后台使用Selenium,提供了相同的灵活性和跨浏览器支持。

It also supports iframes and multiple browser tabs.

它还支持iframe和多个浏览器标签。

The main advantage is the API is a bit easier to use, adding a layer of simplicity over the heavy Selenium API.

主要优点是该API易于使用,在繁重的Selenium API之上增加了一层简单性。

The main disadvantage of using Watir is that it’s less popular than Selenium and that makes finding answers for your questions a bit more difficult.

使用Watir的主要缺点是,它不如Selenium受欢迎,这使得为您的问题寻找答案更加困难。

Website: http://watir.com/

网站: http//watir.com/

4.木偶 (4. Puppeteer)

Image for post

A Node library which provides an API to control Chromium or Chrome over the DevTools Protocol.

节点库,提供通过DevTools协议控制Chromium或Chrome的API。

I see it as a potential replacement for Selenium in the distant future.

我认为它可以在不久的将来替代Selenium。

It has the flexibility to deal with scenarios that involve iframes and multiple browser tabs.

它具有处理涉及iframe和多个浏览器标签的方案的灵活性。

It’s worth knowing that there are 2 different packages: puppeteer-core and puppeteer.

值得一提的是,有2种不同的软件包:puppeteer-core和puppeteer。

The only difference is that puppeteer-core doesn’t automatically download Chromium when installed.

唯一的区别是puppeteer-core在安装后不会自动下载Chromium。

The main disadvantage is the lack of cross-browser capabilities, since it only works with Chromium-based browsers.

主要缺点是缺乏跨浏览器功能,因为它仅适用于基于Chromium的浏览器。

Even if Opera and Edge moved to Chromium, there’s no guarantee that Firefox and Safari will do the same in the future.

即使Opera和Edge迁移到Chromium,也无法保证Firefox和Safari将来也会这样做。

Another disadvantage is that the only supported language is Node.js.

另一个缺点是,唯一受支持的语言是Node.js。

Even if everything seems to revolve around JS in 2020, some users might want to use other languages.

即使到2020年一切似乎都围绕JS展开,一些用户还是可能想使用其他语言。

Website: https://pptr.dev/

网站: https//pptr.dev/

5.剧作家 (5. Playwright)

Image for post

A Node library to automate Chromium, Firefox and WebKit with a single API.

一个Node库,可通过单个API自动化Chromium,Firefox和WebKit。

Playwright is built to automate a growing set of web browsers.

Playwright旨在自动实现不断增长的Web浏览器集。

The experience is similar to Puppeteer.

经验类似于木偶戏。

It can automate scenarios that involve multiple page, domains and iframes.

它可以自动化涉及多个页面,域和iframe的方案。

Emulating mobile devices, geolocation and permissions is also possible.

模拟移动设备,地理位置和权限也是可能的。

Even if it has a wider cross-browser support, it does not support Internet Explorer.

即使它具有更广泛的跨浏览器支持,它也不支持Internet Explorer。

Because it’s a relatively new library, you might not find a lot of resources online just yet.

因为它是一个相对较新的库,所以您可能现在在线上找不到很多资源。

If you have solid experience with writing Node.js code, this might be an interesting option to consider.

如果您在编写Node.js代码方面有扎实的经验,那么考虑这可能是一个有趣的选择。

https://playwright.dev/

https://playwright.dev/

6.西库利 (6. Sikuli)

Image for post

Sikuli can automate anything you see on the screen of your desktop computer running Windows, Mac or Linux.

Sikuli可以自动执行在运行Windows,Mac或Linux的台式计算机屏幕上看到的任何内容。

It’s using image recognition powered by OpenCV to identify visual components.

它使用由OpenCV提供支持的图像识别来识别视觉组件。

This is handy in cases when there is no easy access to a GUI’s internals or the source code of the application or web page you want to act on.

如果无法轻松访问GUI的内部结构或要操作的应用程序或网页的源代码,这非常方便。

It’s actually the technology behind most modern RPA solutions.

实际上,这是大多数现代RPA解决方案背后的技术。

The advantage of using Sikuli is that it doesn’t matter if your elements have unique attributes or if those attributes change, because Sikuli relies only on visual recognition.

使用Sikuli的优点是,元素具有唯一属性或属性是否改变都无关紧要,因为Sikuli仅依赖于视觉识别。

The main disadvantage is that the visual tolerance makes it difficult to automate across different browsers and screen sizes.

主要缺点是视觉容忍度使得很难在不同的浏览器和屏幕尺寸之间实现自动化。

Programming skills are required to use this library and you can choose between Python, Ruby and Java.

使用此库需要编程技巧,并且您可以在Python,Ruby和Java之间进行选择。

If you have hybrid automated tests, which involve web applications and desktop applications, a good practice is to use Selenium for the web components and Sikuli for the desktop components.

如果您有涉及Web应用程序和桌面应用程序的混合自动化测试,则好的做法是将Selenium用于Web组件,将Sikuli用于桌面组件。

Website: http://sikulix.com/

网站: http//sikulix.com/

7. Micro Focus UFT (7. Micro Focus UFT)

Image for post

A proprietary solution, formerly known as QuickTest Professional (QTP).

专有解决方案,以前称为QuickTest Professional(QTP)。

It offers capabilities to automate web applications and desktop applications.

它提供了使Web应用程序和桌面应用程序自动化的功能。

It’s using the Visual Basic scripting language to locate and interact with the elements from applications.

它使用Visual Basic脚本语言来定位应用程序中的元素并与之交互。

It also offers an IDE where you can build your test without writing any code, simply by creating a flow in a GUI.

它还提供了一个IDE,您只需在GUI中创建一个流程即可在不编写任何代码的情况下构建测试。

This tool has been around for a long time and it did lose a lot of market share to Selenium.

该工具已经存在很长时间了,它确实使Selenium失去了很多市场份额。

Website: https://www.microfocus.com/en-us/products/uft-one/overview

网站: https//www.microfocus.com/en-us/products/uft-one/overview

8. IBM Rational Functional Tester (8. IBM Rational Functional Tester)

Image for post

A proprietary tool that provides automated testing capabilities for functional, regression, GUI and data-driven testing.

提供功能,回归,GUI和数据驱动测试的自动化测试功能的专有工具。

It does include limited cross-browser capabilities, since it works only with Chrome, Firefox and Internet Explorer.

它确实包括有限的跨浏览器功能,因为它仅适用于Chrome,Firefox和Internet Explorer。

The main advantage is that it can also be used for automating desktop applications.

主要优点是它还可用于自动化桌面应用程序。

One of the advantages is that it has an Eclipse Java Developer Toolkit editor, which makes it easy for your team to code test scripts in Java with Eclipse.

优势之一是它具有Eclipse Java Developer Toolkit编辑器,这使您的团队可以轻松地使用Eclipse在Java中编写测试脚本。

The Toolkit editor includes features such as code completion and advanced debugging options.

工具包编辑器包含功能,例如代码完成和高级调试选项。

Integrating IBM Rational Functional Tester with a CI/CD system might prove to be difficult, since it’s designed to be used on your own workstation.

将IBM Rational Functional Tester与CI / CD系统集成可能很困难,因为它被设计用于您自己的工作站上。

Website: https://www.ibm.com/us-en/marketplace/rational-functional-tester

网站: https//www.ibm.com/us-zh/marketplace/rational-functional-tester

9.开玩笑 (9. Jest)

Image for post

Jest is a JavaScript framework which allows you to access the DOM via jsdom.

Jest是一个JavaScript框架,允许您通过jsdom访问DOM。

It’s worth knowing that jsdom is only an approximation of how the browser works, it may be good enough for testing React components, but it is not a relevant option for reliable cross-browser testing.

值得一提的是,jsdom只是浏览器工作方式的一种近似,它可能足以测试React组件,但它并不是可靠的跨浏览器测试的相关选项。

Jest does provide a good iteration speed and it has powerful features like mocking modules and timers.

Jest确实提供了良好的迭代速度,并且具有强大的功能,例如模拟模块和计时器。

Ideally, it should be used by developers to test certain components, but the results will not guarantee that the application works as expected in the actual browsers.

理想情况下,开发人员应使用它来测试某些组件,但结果不能保证该应用程序在实际的浏览器中可以正常工作。

Website: https://jestjs.io/

网站: https//jestjs.io/

10.Cucumber (10. Cucumber)

Image for post

Cucumber is an open-source Behavior Driven Development (BDD) tool.

Cucumber是一种开源的行为驱动开发(BDD)工具。

It supports multiple languages, including Ruby, Java, Scala and Groovy.

它支持多种语言,包括Ruby,Java,Scala和Groovy。

Building the test scripts does require programming skills.

构建测试脚本确实需要编程技能。

The actual functions can be called by using Gherkin.

实际功能可以通过使用Gherkin来调用。

The obvious advantage of using Cucumber is that the scenarios can be easily understood by non-technical users.

使用Cucumber的明显优势是,非技术用户可以轻松理解这些方案。

It would be correct to say that Cucumber is not a replacement for Selenium, it’s simply a wrapper over Selenium.

说Cucumber不是Selenium的替代品是正确的,它只是Selenium的包装。

A combination of Selenium and Cucumber increases the readability of the code and makes it more easy to re-use components.

Selenium和Cucumber的组合可提高代码的可读性,并使其更易于重用组件。

Website: https://cucumber.io/

网站: https//cucumber.io/

翻译自: https://medium.com/swlh/the-10-best-test-automation-tools-a51e76c091df

自动化测试 单元测试 工具

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值