如何使用Vaadin 10执行负载测试/性能测试(使用Jmeter可以吗?) [英] How to perform an Load Test/Performance Test with Vaadin 10 (is it possible with Jmeter?)

查看:214
本文介绍了如何使用Vaadin 10执行负载测试/性能测试(使用Jmeter可以吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从事Vaadin 10项目的工作,我们想在我们的网站上执行负载测试,因为我们使用Vaadin 10可以使用Jmeter做到这一点,但是使用Vaadin 10似乎不适用于Jmeter

I Work on an Vaadin 10 Project and we want to perform an Load Test on our Website befor we used Vaadin 10 we could do that with Jmeter but with Vaadin 10 it seems that it doesnt work with Jmeter

我们尝试使用Jmeter 5.1.1并记录了测试用例,第一个问题是csrf Toaken和push id,它们都可以用正则表达式提取器提取,然后将它们放在Body数据中

We Tryed using Jmeter 5.1.1 and recorded the testcase the first problem was the csrf Toaken and the push id, both could get extracted with an regular expression extractor and we put them in the Body Data

{"csrfToken":"${csrf}","rpc":  [{"type":"mSync","node":5,"feature":1,"property":"invalid","value":true}],"  syncId":0,"clientId":0}

就我所见,至少可以奏效,但我们得到的唯一结果是一个HTML站点,显示您必须在浏览器中启用javascript才能使用该站点."

as far as i could see at least that worked but the only result we get back is an html site with "You have to enable javascript in your browser to use this web site."

有人知道是否有更好的方法可以对vaadin 10应用程序执行负载测试,或者如何使其与jmeter一起使用?

does anyone know if there are better ways to perform an load test on an vaadin 10 application or how to get it working with jmeter?

直到找到为止,我发现的大多数答案都是针对vaadin 8或7的,而对于vadin 10+则没有答案.

most answeres i found until know are for vaadin 8 or 7, butn none for vadin 10+

推荐答案

是的,可以使用JMeter进行Vaadin 10+应用程序的负载测试.您应该可以使用以下正则表达式提取csrf令牌:

Yes, it is possible to use JMeter for load test Vaadin 10+ applications. You should be able to use following regex for extracting the csrf token:

Vaadin-Security-Key":"(.+?)"

针对Vaadin 13 Bakery应用入门测试时,我的JMeter屏幕截图:

A screenshot of my JMeter when testing against Vaadin 13 Bakery app starter:

除了JMeter之外,在对Vaadin(任何版本)应用程序进行可伸缩性测试时,Gatling也是一个不错的选择.面包店App入门版中有一个很好的示例加特林测试脚本,用于Vaadin 13: https://vaadin.com/start/latest/full-stack-spring 参见项目的路径:\ src \ test \ scala \ BaristaFlow.scala.

In addition to JMeter, Gatling is also a good option when scalability testing Vaadin (any version) applications. There is a quite good example Gatling test script in Bakery App starter for Vaadin 13: https://vaadin.com/start/latest/full-stack-spring See the path: \src\test\scala\BaristaFlow.scala of the project.

我在此处上传了针对V13应用程序(相同的Bakery Flow入门程序)的小型但功能齐全的JMeter测试: https://gist.github.com/johannest/593309e31e35789f8e5b03bed074f13c

I uploaded a small but fully functioning JMeter test against V13 application (the same Bakery Flow starter) here: https://gist.github.com/johannest/593309e31e35789f8e5b03bed074f13c

示例脚本显示了csrf令牌提取,以及如何提取组件ID(例如用于"New"按钮的ID)以及客户端和同步ID.提取这些ID并将其用作以下请求中的变量(而不是使用记录的ID)可以使您的测试更加稳定.

The example script shows the csrf token extract, but also how to extract component ids (such as an id used for the "New" button) and client and sync ids. Extracting these ids and using them as variables in the following requests (instead of using recorded ids) makes your test more stable.

这篇关于如何使用Vaadin 10执行负载测试/性能测试(使用Jmeter可以吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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