jmeter 与 硒

发布于 2024-09-30 20:11:19 字数 151 浏览 1 评论 0原文

你好,我想进入测试自动化领域,我在第一次网络搜索中找到的两个工具是 Selenium 和 Jmeter。

你认为哪一个是第一个看到的?或者我是否需要这两种工具,因为它们完全不同?

我需要的是能够进行客户端证书身份验证、使用不同信息填写表单以及检查结果页面。

Hi, I want to get into test automation, and the two tools I found during my first web search are Selenium and Jmeter.

Which one do you think is the first to have a look at? Or do I need both tools as they're totally different?

What I would need is the possibility to do Clientside-Certificate-Authentication, filling forms with different Information, and checking result pages.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一城柳絮吹成雪 2024-10-07 20:11:19

Apache JMeter 绝对是性能测试和负载/压力测试的工具。但是您也可以将它用于功能测试(在您的示例中:填写表单 -> 检查结果,但检查结果是否符合预期 - 但最好不要与他一起进行功能测试)

对于功能测试另一方面有SeleniumCanoo web test

所以最终的答案是将这两者结合起来。 (我使用 JMeter 进行性能测试,使用 canoo web test 进行功能测试,但我想现在 Selenium 是更好的选择)

Apache JMeter is definitely tool for performance testing and load/stress tests. But you can use it also for functional tests as well (in your example: fill form ->check results but with checking if results are as expected - but better don't do functional testing with him)

For functional testing on the other hand there are Selenium and also Canoo web test.

So final answer will be to combine those two. (I was using JMeter for performance tests and canoo web test for functional testing, but I guess that Selenium is much better choice now)

眼眸里的那抹悲凉 2024-10-07 20:11:19
  • 使用 Selenium 进行功能测试
  • 使用 JMeter 进行压力测试并测量性能
  • Use Selenium for your functional tests
  • Use JMeter for stress tests, and measure performance
思慕 2024-10-07 20:11:19

在这两种情况下,您都可以记录会话,因此您可以启动 Selenium 或 JMeter 引擎,在浏览器中执行某些操作,然后停止记录。之后,您可以使用 Selenium 或 JMeter 再次运行记录的会话。

Selenium 测试浏览器字段和按钮。在 Selenium 中,您可以填写输入字段并单击按钮,等待页面加载,然后检查页面。

Jmeter 可用于测试用户浏览器 GET 和 POST 通信。在 Jmeter 中,您可以像浏览器一样请求 URL 并发布一些参数,然后检查页面响应。

优点和缺点:

如果你想测试 javascript 页面功能,Selenium 是不错的选择。

如果您想用 Java、Javascript、Python 或简单的 html 文本文件编写测试用例,Selenium 是不错的选择。 Selenium 可以用多种编程语言格式化您的测试用例。 JMeter 始终使用 XML 格式来存储测试用例。

如果您不想处理浏览器版本,JMeter 会很好。 JMeter 适用于所有浏览器。 Selenium 拥有大量支持的浏览器,但始终有浏览器要求。

如果您还想记录 HTTP、SOAP 和 RESTFul 协议,JMeter 是不错的选择。 JMeter可用于记录和测试服务器之间的通信。 JMeter 不需要浏览器来运行,而 Selenium 需要。

JMeter 可以运行来自 JMeter 测试的 SQL 查询、bash 脚本、Java 类...。另一方面,Selenium 测试可以嵌入到 Java、Python、Javascript 等程序中。

两者都支持 xpath、html 检查、css 检查等

In both cases you can record a session, so you can start your Selenium or JMeter engine, do something in your browser and then stop recording. After that you can use Selenium or JMeter to run the session recorded again.

Selenium tests browser fields and buttons. In Selenium you can fill a input field and click a button, wait for the page load and then inspect the page.

Jmeter could be used for testing user-browser GET and POST communications. In Jmeter you can request an URL and post some parameters like the browser do and then inspect the page response.

PROS and CONS:

Selenium is good if you want to test javascript page functionalities.

Selenium is good if you want to have your test cases written in Java, Javascript, Python or simple html text files. Selenium can format your test cases in many programming languages. JMeter always uses an XML format for store test cases.

JMeter is good if you don't want to deal with browser versions. JMeter works in all browsers. Selenium has a wide list of supported browsers, but will always have browser requirements.

JMeter is good if you want to also record HTTP, SOAP and RESTFul protocols. JMeter can be used for record and test communications between servers. JMeter doesn't need a browser to run, Selenium does.

JMeter can run SQL queries, bash scripts, Java classes, ... from JMeter test. By the other hand, Selenium tests can be embedded in Java, Python, Javascript, ... programs.

Both supports xpath, html inspection, css inspection, ...

简单爱 2024-10-07 20:11:19

正如上面回复中提到的,Selenium 是一个用于测试功能的工具。通常将其描述为自动化测试工具,而另一方面 JMeter 是用于性能测试的工具。

我建议从 Selenium 开始,因为任何 Web 应用程序最重要的方面是它正常工作。尝试创建几个基本的测试套件,其中包含验证某些功能的最重要的自动化测试。一旦您至少掌握了基本的自动化测试知识,我就会转向 JMeter 和性能测试。

根据我个人的经验,性能测试比自动化测试需要更多关于被测试系统的知识。 JMeter 和 Selenium 学习起来都不复杂,但对于性能测试,您需要更多有关测试的 Web 应用程序的知识。

as mentioned in above replies, Selenium is a tool for testing functionality. Usually its described as a tool for automated testing, while on other hand JMeter is a tool used for performance testing.

I would suggest to start off with Selenium, since the most important aspect of any web application is that it's working correctly. Try to create the basic suite of couple of tests, with the most important automated tests that verify some functionality. Once you have the base automated testing knowledge at least, I would move on to JMeter and performance testing.

In my personal experience, performance testing requires much more knowledge about the system being tested than automated testing. Both JMeter and Selenium should not be complex to learn, but for performance testing you need to more about web application tested.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文