4
votes

I work on a Vaadin 10 project and we want to perform a load test on our website. Before we used Vaadin 10, we could do that with Jmeter but with Vaadin 10 it seems that JMeter doesn't work.

We tried using JMeter 5.1.1 and recorded the test case. The first problem was the CSRF token and the push id. Both could get extracted with a 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 can see, at least that worked, but the only result we get back is a HTML page with "You have to enable javascript in your browser to use this web site."

Does anyone know if there are better ways to perform a load test on a Vaadin 10 application or how to get it working with JMeter?

Most answers I found until now are for Vaadin 8 or 7, but none for Vaadin 10+.

2
Regarding the JS part, it's expectable and has nothing to do with Flow. More discussions on this topic here: JMeter and JavaScript and here JMeter: JavaScript seems to be disabled in your browseranasmi

2 Answers

9
votes

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:

enter image description here

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.

0
votes

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