通过 JMeter 处理客户端操作(不是通过 Selenium 集成)
Handle Client side actions through JMeter (NOT through Selenium integration)
具有功能列表(客户端操作)的 Web 应用程序,当我通过 Jmeter/Blazemeter(非-API(非 HTTP)类型记录时,这些功能未被捕获东西)。这些操作通过 Javascript 函数处理,并且 .js 文件未显示在“网络”选项卡中。
因此,我创建了 selenium 脚本并将它们与 Jmeter 集成。当我 运行 脚本时,它会打开许多浏览器实例(无头)并且性能统计数据会受到影响。
我必须 运行 这个脚本有 5000 个线程。所以打开这么多浏览器实例不是一个合适的做法。
如何通过 JMeter 处理客户端操作?
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
因此您需要弄清楚这个“客户端 JavaScript”代码在做什么,并通过以下方式复制此功能:
- 要么使用合适的 JMeter Plugin
- 或writing your own JMeter Plugin
- 或使用 JSR223 Test Elements and Groovy language
模拟此客户端 JavaScript
具有功能列表(客户端操作)的 Web 应用程序,当我通过 Jmeter/Blazemeter(非-API(非 HTTP)类型记录时,这些功能未被捕获东西)。这些操作通过 Javascript 函数处理,并且 .js 文件未显示在“网络”选项卡中。
因此,我创建了 selenium 脚本并将它们与 Jmeter 集成。当我 运行 脚本时,它会打开许多浏览器实例(无头)并且性能统计数据会受到影响。
我必须 运行 这个脚本有 5000 个线程。所以打开这么多浏览器实例不是一个合适的做法。
如何通过 JMeter 处理客户端操作?
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
因此您需要弄清楚这个“客户端 JavaScript”代码在做什么,并通过以下方式复制此功能:
- 要么使用合适的 JMeter Plugin
- 或writing your own JMeter Plugin
- 或使用 JSR223 Test Elements and Groovy language 模拟此客户端 JavaScript