负载测试网站 UI

Load testing web UI

我想测试 500 个用户同时使用我的网络应用程序。

我研究过 运行 并行使用 Selenium Web 驱动程序或使用 JMeter Web 驱动程序,但我看到其他人建议在一台机器上一次只使用 运行 ~5 个。

有没有一种可行的方法可以在一台机器上(或至少少于 100 台)测试我想要的东西?

您可以进行两种类型的测试:

  1. Client-side 性能测试,即渲染速度、脚本效率等。为此你不需要超过 1 个浏览器/虚拟用户,你可以使用你最喜欢的 browser developer tools which have Performance / Audit tabs where you can analyze your request timeline 并确定最慢的部分

  2. Server-side 性能测试。本练习仅关注被测应用程序的性能,让您深入了解您的应用程序可以处理多少并发用户,从而提供可接受的响应时间/吞吐量。你不需要任何浏览器,因为浏览器不会做任何魔法,它们只是在处理嵌入式资源、cookie、headers、缓存、AJAX 请求方面发送 HTTP requests and render the responses. You can mimic the same behavior using JMeter's HTTP Request sampler, just make sure to perform the associated configuration so requests originating from JMeter would look like a real browser,等等

    Protocol-based 方法的 CPU/Memory 占用空间小得多,因此您可以通过 mid-range 现代笔记本电脑模拟成千上万的用户(假设您关注 JMeter Best Practices). Check out WebDriver Sampler Tutorial

    Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.

    假设以上所有情况,您应该专注于使用 HTTP 请求采样器创建负载,并在需要时使用 1-2 个 WebDriver 采样器来测量 client-side 性能(例如使用 Navigation Timing API)。