Testing a Vaadin Website with JMeter - jmeter

I need to test a Vaadin website with JMeter but I can't get it to work. I have tried recording my actions with a proxy and that went well, but when i try to run the test again it gives me an error: out of sync. I have disabled the xsrf.
Has this something todo with the fact Vaadin can't run in two tabs at the same time? I am using vaadin 6 and i can't easily upgrade.
Thanks in advance Stefan
the error response i get is:
for(;;);[{"changes":[], "meta" : {"appError": {"caption":"Out of sync","message" : "Something has caused us to be out of sync with the server.Take note of any unsaved data, and click here</u> to re-sync.","url" : null}}, "resources": {}, "locales":[]}]
Solution:
- Disable xrsf because when you record and then start a new thread the request is sends the wrong security key. Enable it when going live ofcourse!
- Make sure ever component is unique and consitent. The problem in my application was that the id's of the components were changing every request. So the request when recording is only validate while recording. When i replayed it, it asks for the wrong id. By making it unique and consitent this problem dissapears!
Good luck and have fun ;)

Read this:
https://vaadin.com/wiki/-/wiki/Main/JMeter%20Testing
Issue might be in disabling XSRF.
However, scripting Vaadin application is not easy as there are a lot of technical ids to correlate to create a successful simulation.
Either you do correlation manually which will require some work or you can use this commercial plugin for JMeter.
Note that disabling XSRF is only a part of the problem and will not solve all issues. And disabling it will not make application ISO-PROD.
Disclaimer : We are providers of this solution

in case you cannot disable XSRF protection, automatic correlations feature of SmartMeter (based on JMeter) is the solution. While recording the test, it will automatically parse XSRF tokens from responses and use them in subsequent requests. Here is a detailed guide.

Related

cy.visit() failed because while attempting to visit a second unique domain/location/url in a single test case

I need to navigate two different urls in a single Test but when am navigating second one , it giving me error
1.FirstUrl- "https://app.ca-test.com/Public/Login?ReturnUrl=%2F"
2.SecondUrl -"https://www.mailinator.com/"(location and origin is change)
"cy.visit() failed because you are attempting to visit a URL that is of a different origin."
I used cy.request() also but didn't work
so how can we do this??
But i have to navigate two urls in single test, and can not divide test case. This is my TestCase
Cypress is preventing going cross origin since always forever. This was kinda covered in this question, but only kinda.
To sum up:
Different domains in one test are not officially supported, at least not yet. There is a whole section regarding this in the Cypress documentation
There is a feature request on their board to support more than
one, but I don't see it being implemented anytime soon, there are some workarounds posted in that ticket, maybe one of them will work for you.
You could disable chrome cross-origin security by adding chromeWebSecurity: false to the cypress.json config file
If you want to use Mailinator to check/send emails, why do you have to visit the site? Just use their API and cy.request()
Never link your test environment directly here.

Can Charles map incoming request using saved session?

In my team, QA will test the application, if there's a bug, QA will record a charles session and provide the file to developer.
Now as a developer, I want to quickly reproduce the bug. Currently what I do is manually save the response, then use the "map local" tool to create a "map local" relationship between the request and response.
But it's tedious and cumbersome if there're multiple requests I need to mock. I'm thinking is it possible just simply tell charles, "hey charles, Use the current recorded session as source, if any future request match one of the recorded request, just use the recorded response. if none request match, let it pass through".
Then when I get a charles session file, it'll be very easy for me the set up the mock response. I can start troubleshooting the bug in just seconds.
I'm not sure if this can help but basically, if QAs spot any bugs, they can use the "export flow" feature and then share with you these exported files. When you import such files, you would be able to reproduce quickly without setting up as the request/ response have already been saved.
However the tool I'm using is Proxyman instead of Charles. You can find the detail instruction at
https://proxyman.io/blog/2019/07/How-I-use-Proxyman-to-report-bugs-more-effectively.html. Hope it helps!

How to perform an Load Test/Performance Test with Vaadin 10 with JMeter

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

Data correlation and concurrent users with Jmeter

This is Naresh. Seems this blog is really helpful for the beginners and all.
I have chosen Jmeter for Perf. testing web-based application and it is build with the environment - Microsoft dot net(Asp.net 3.5 with C#). Would Jmeter helps me?
I have done some sample recordings, for e.g login and search.
Scenario1 - Login
Here I have recorded for login and then parameterized with CSV config file.
And executed later.
As I do not much hand on exp, do I need to add anything to the above config to run it perfectly. For e.g. adding HTTP cookie manager or ?????
How to run the concurrent users?
Scenario 2:
Here, I have logged in - login.aspx is recorded
given a search - search.aspx is recorded
results will be displayed right below the search in a tabular format - (same)search.aspx is recorded
I want to run this for 100 simultaneous search(s). I understood how to pass the CSV file.
I am sure there is some thing needed to be done for executing this scenario.
Do I have need to do Data correlation, if yes? how to do this?
Do I need to add HTTP cookie manager or HTTP cache manager......
Please help guys, would be grateful :)
Naresh
Yes you must add the HTTP Cookie manager and HTTP cache manager

jmeter regarding performance and load testing

Let me describe the issue which i have been facing.
i want to do performance and load testing on our internal website. which has login and other functionalities.
the issue i am facing that when i hit 12 or any number of request using http sampler then i am getting same response from all the 12 request. But actual scenario is that webpage displays different data for different page.
I checked using firebug and everything is working fine over there using correct response from request but when i use jmeter i am using same response from every request.
Please let me know if anybody had faced same kind of issue of is there anything i am doing wrong in configuring script.
Try to add HTTP Cookie Manager to your test-plan to the root (Test Plan) node or to the Thread Group node.
As per jmeter documentation:
The last element is a HTTP Cookie Manager. A Cookie Manager should be
added to all web tests - otherwise JMeter will ignore cookies. By
adding it at the Thread Group level, we ensure that all HTTP requests
will share the same cookies.
Ensure that parameters values that are dynamic are not hard-coded (after recording jmeter scripts, for example): no hard-coded JSessionID values in your HTTP requests, e.g..
Ensure you don't miss any necessary params in your HTTP requests.
JMeter does not process Javascript or applets embedded in HTML pages.
Your problem may be caused by this feature.
As per jmeter documentation:
JMeter does not process Javascript or applets embedded in HTML pages.
JMeter can download the relevant resources (some embedded resources
are downloaded automatically if the correct options are set), but it
does not process the HTML and execute any Javascript functions.
If the page uses Javascript to build up a URL or submit a form, you
can use the Proxy Recording facility to create the necessary sampler.
If this is not possible, then manual inspection of the code may be
needed to determine what the Javascript is doing.
I would also recommend your to look first into Jmeter reference before further scripting activities - this may prevent from some faults and frustration.
At least these:
Building a Test Plan
Elements of a Test Plan
Building a Web Test Plan
Building an Advanced Web Test Plan
Hope this helps.
I would suggest - Use Jmeter's Regular Expressions. You may be able to resolve this issue with RegEx. Post using regex, use 'View Results Tree' listener to check if you are getting apt response for each of your threads.
You can also analyze your results using Blazemeter's listener that gives you more insights into your test.

Resources