How to perform an Load Test/Performance Test with

2020-07-17 07:42发布

问题:

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

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}

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."

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?

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

回答1:

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":"(.+?)"

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

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.

Edit:

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

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.



回答2:

I postet this question a time ago since some people have intresst in this Question i will post some informations how we dealed with the situation.

  1. our application didnt want to work with J-Meter it should be possible with jmeter but i did not manage to get it to an working state
  2. we used neoLoad(the trail version was sufficient for our use case) and neoload was easy to use for Vaadin 10 but i cant give detailed informations how to use neoLoad with vaadin 10 but maybe someone can use this information to shorten the research time