Issue with CAS login - jmeter

I am new to jmeter and trying to login in one of our client application which uses CAS system, but not able to succeed. I have also applied regular expression extractor for "lt", but not works.
each time it gives this error:
ticket 'LT-9528-aTBBoBdZU23g6khtS9I0b5Lq3o2VUQ' not recognized

It looks like you're using hard-coded login ticked (recorded one). You need to perform so-called correlation - the process of identifying dynamic parameters, extracting and re-using them.
See How to Load Test CSRF-Protected Web Sites to get an idea regarding approaches.
Also it worth checking Apache JMeter page of Jasig wiki, it seems to contain some JMeter scripts which you can use as a reference.

Related

How to do performance testing with key-cloak authentication in Jmeter

I try to do performance testing but particular site have enable key-cloak authentication.any suggesstions
It's just a matter of correlation, the exact steps will be different for OpenID Connect and SAML so you need to determine which client protocol is being used in that particular Keycloak instance.
In order to get help with correlating individual parameters you will need to provide the previous response and the format of the next request so we could come up with the relevant instructions for JMeter Post-Processors setup.

Trying to Performance test an application developed in OJET technology. Which tool/protocol should I use for scripting?

Trying to Performance test an application developed in OJET technology. Which tool/protocol should I use for scripting? I tried HTTP/Web protocol with Jmeter and Load Runner. But that doesn't capture all the requests and responses at the javascript/browser level. Hence I am facing issues in correlating the dynamic values during test design. Hence, scripts fail during the replay. Currently trying to do it with Truclient Web protocol as an alternative. But I need to know which tool/protocol should I use for scripting?
According to OJET looks like this is a web app generator.
If you choose to start with JMeter use post-processor such as regex to catch and save every value that is needed for as arg in the next request.
Don't be afraid of these dynamic values. Try to follow next articles to get the idea.
None of tools will provide you automatic correlation without issue. Nor LoadRunner, nor Jmeter. It is always tricky.
Ask more specific questions when you start facing issue.
Jmeter catch correlations
You need to implement real user using your application with 100% accuracy in terms of network footprint
Both JMeter and/or LoadRunner are not capable of executing client-side JavaScript, the options are in:
Implement these JavaScript-driven network calls using scripting (in JMeter it will be JSR223 Test Elements)
Use a real browser, LoadRunner's Truclient protocol is basically a headless web browser, in JMeter can be integrated with Selenium browser automation framework via WebDriver Sampler
With regards to "which protocol/tool" to use:
Implementing JavaScript calls manually will take extra effort, however your test will consume less resources (CPU, RAM, etc.)
Using real browsers will take less efforts, but the test will consume much more resources (something like 1 CPU core and 2 GB of RAM per user/ browser instance) and you won't have metrics like Connect Time, Latency, etc.
LoadRunner TruClient. This will handle all of the Javascript executions and dynamic elements related to session, state, date/time, object identifiers, ... You will still need to appropriately handle user input items.

Automated API blackbox testing

I have a (slightly complex) spring webservice which communicates with multiple frontends via a RESTful API (JSON) and additionally with other devices via SOAP or REST. I'd like setup an automated test environment which is capable of the following things:
create preconditions via fixtures (POSTGRES DB)
send REST or SOAP messages against the API
is able to run certain task (requests against the API) at a specific
time/date
assert and validate the produced results (return of the API call or
check the DB)
run all tests independet from any frontend/UI
integrate the testing environment in my infrastructure (i.e. create a
docker container which runs all tests deployed by Jenkins)
preferably I'd like to build reusable components (i.e. for creating a user that is needed in multiple different tests and so on...). I know there are a lot of tools and frameworks (SoapUI, JMETER,...). But before trying them all and getting lost, I'd like to get an experience report from someone who has a simular setup.
we are using JMeter for API testing. We tried SOAPui but it had some memory issues. So we are pushing forward with JMeter and so far so good.
For your questions:
We are using MySQL, but this post seems to show how to set up a postgres connection in JMeter: https://hiromia.blogspot.com/2015/03/how-to-perform-load-testing-on.html
JMeter can send REST API requests
I'm not sure if this is possible but you could probably have your Jenkins job scheduled to run when you need the API to run the specific task at the specific time.
There are quite a few assertions in JMeter. I use the Response and the BeanShell Assertions a lot.
JMeter is independent from any front end UI which helps pinpoint bugs.
I have not run docker but I am running via Jenkins. This jenkins plugin has been helpful: https://wiki.jenkins.io/display/JENKINS/Log+Parser+Plugin
A few more Tips:
Use the HTTP Request Defaults element. It will save you from having to update all your HTTP requests.
Use the User Defined Variables to define variables you need.
You can combine user defined variables like: ${namePrefix}${myTime} but it will have to be in a 2nd User Defined Variable element(you cant combine them in the same element)
If you have multiple test environments, set up a user defined variable with a value like this: ${__P(testenv,staging)} This way, you can change it from a CLI like this: -Jtestenv=HOTFIX
We are using ExtentReports for pretty html results reports with a custom JSR223 Listener(find my old post on this site).
If your site uses cookies, use the HTTP Cookie Manager.
If you need things to happen in order, on the Test Plan element, check this option: Run Threat Groups consecutively. If you dont, JMeter runs them in a random order.
Hope this is helpful. Happy Testing!

Handling the View state values and event validations in ASP.NET Application with Jmeter

I have created a script for application server by using my machine and now I want to run this script, but when I am running this script, I'm getting following error:
Validation of view state MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Could anybody can help me? How to handle this?
You need to extract both __VIEWSTATE and __EVENTVALIDATION from the previous response, store them into JMeter Variables and add as parameters to the next request.
The whole process is known as correlation and there is a lot of information on it over the Internet. The most commonly used Test Element for extracting dynamic values from responses is Regular Expression Extractor, however other options exist.
For ASP.NET web applications specifics you can check out ASP.NET Login Testing with JMeter guide

Apache JMeter HTTP(S) Test Script Recorder not generating samples

I am new to JMeter and have been following the steps outlined in usermanual/jmeter_proxy_step_by_step.pdf.
I am using the Recording Controller.
I have tried to connect to http://jmeter.apache.org/ per the steps outlined but no samples are generated.
I stopped the Proxy and confirmed that i could no longer load pages, so I am confident that I am connecting via the proxy.
Why are no samples being generated?
I'm not seeing any errors...
Check following fields in Recorder:
URL Patterns to Include
URL Patterns to Exclude
Content-Type Filter : Include, Exclude
If one of them contains wrong pattern or info, sampler will not be generated as JMeter will consider you exclude it.
Also check you don't have errors in jmeter.log
Are you sure that your browser is configured to use a proxy? The majority of browsers have no proxy for localhost/127.0.0.1 or something like that. It's likely that your accessing your application not through JMeter proxy but directly.
By the way, do you know that there is an extension for Google Chrome which can record JMeter scripts right from browser without having to worry about proxies, certificates, etc?

Resources