Immediate help required - Getting error 403 and 500 in jmeter - jmeter

I am working with Jmeter to do load testing. I created a simple login script using BlazeMeter. Then I imported the file into Jmeter.
Whenever I try to run the script, it fails. The problem I encounter here is that 2 of my https requests I receive a 403 and 500 response code.
enter image description here
Output
I added an HTTP Authorization Manager to try and solve this but it is not working. Do you have any suggestions on how to resolve this?
I tried adding post processors but couldn't make them work.

First of all Template value in the Regular Expression Extractor should be $1$
Also your regular expression itself looks kind of weird and I doubt it matches anything. You can check whether it generates the proper ${state} variable by using Debug Sampler and View Results Tree listener combination
In general using regular expressions for parsing HTML is not the best idea, it worth considering migrating to CSS Selector Extractor

Related

How can I resolve this Session ID problem in Jmeter?

I am working on a Jmeter login script. To create this script I used blazemeter. The thing is that it is not working correctly as I get a http 403 response code.
Thanks to fire fox I know that in my header I need to send the next data whenever I do a GET to the web page:
This is how I do it in JMETER:
Extractor:
This is the response:
The problem I am having is that the session id is not working correctly. I dont know if this is the problem why I have a 403 response code but it is still a problem. I tried everything to solve this error code but I failed so I need to start from the beginning
Look at this:
Do you have any suggestions to resolve this problem of the sesison id? If you do, I would really appreciate it
UDPATE:
I changed the variable in the petition because I was naming it wrong but I am still having issues. No id appears:
You're trying to extract Cookie value from the response message, switch the Regular Expression Extractor to the Response Headers (Cabeceras) and your approach should start working:
Also be aware that you don't even need the Regular Expression Extractor.
Add the next line to user.properties file:
CookieManager.save.cookies=true
Restart JMeter to pick the property up
Add HTTP Cookie Manager to your Test Plan
In the HTTP Header Manager (Gestor de Cabecera HTTP) refer the extracted value as ${COOKIE_GX_CLIENT_ID}

Part of the HTTPS response is changing on every session

I have a HTTP response code. A part of it was changing with application upgrade, so I have created a variable for this and changing the variable after each upgrade and so that it will be automatically updated throughout the JMeter script.
Language|aB5U0Easj5xXnirzSu4eYyOxICkTU9uEgH4TPx/A++/hc6XBB3sgFdHmvXLriQxFq9RCj4T1Zq+fvzXouImGRIc93NkzkPUEMR1xqwMipVw4A4jJRruIBoLQ6SnP6JfOM3O7M0fV2bhJEHuRAoI04WmYI5eRfNCZhvG9e6Ye9h/8qyk8YRCMRfSjqaA1aZKAXPv1yYPFYXej+WDAt8L82LY/jW3URLc7LLDz/da87CZi3MLJgwRJvjhwB1fBu1Wp4mIR0e79ipNeGJyYY7ADxir0r9cYP611NTj+WF4tR5P7/epeDgexHXpuI/o2+q+vaALUn4+QikI+8KtSi5zE0g9oMJ39o/MIWpJIRAr0p4WmUoROB+6nTyNPG0MZaxKkuboD/7c/mdWzDOeB4eBOljGQpwg1PB53eWrSQJ8Gf7utR05sMOe87worG8lm34oAVlU/H32JzY82ig==
The above is the part which is changing and I have created a Variable as Language. And everything is fine till now.
Now, I am facing a new problem after upgrading my application. This variable is changing with every new login, because of this was unable to run the load test. It is giving me the following error.
java.lang.IllegalArgumentException: Error while decrypting message, close tab or re-login
Can someone came across similar issue or if anybody has some idea how to solve this. Please help me !!
So basically you are doing what is known as a "Correlation". The error you are getting is mostly related to correlation. when you are replaying the script, you are using dynamic value from the recording script which is expired.
Check the following:
Have you replaced all the changing values in the scripts with your variable? Maybe you
missed some parts. Some values could be in a request url or in a body data of a Post
request.
Check for other values that are changing, sometimes you will have many values to be
correlated, not just one (ex. JSessionID, CSRF token and ...)
What tool you are using to search for dynamic values and their locations? You can use
JMeter response to check for dynamic values but it is easier if you use Fiddler or if
you know LoadRunner, you can use its scripts comparison capabilities.

handling dynamic pop-up error message in jmeter

I have a Jmeter script for an application for which i get pop up error message intermittently. Where as in jmeter we only come to know that flow got terminated by some failure.But we wont come to know the occurrence of Error pop -up message.
My requirement is if we encounter pop up error i want to write to an external file saying that ,the current page got failed due to pop-up error message.
If we can write the error message it's really great. I'm as of now not getting idea to achieve this.
Please can anyone help me in this. or can provide any hint to do R&D.
Thankyou in advance.
Updated the question with screen shot of error message.
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
Looking into your screenshot, it is a form of JavaScript popup, most likely window.alert so there is no way to detect it via JMeter.
You can add i.e. Response Assertion to your test in order to introduce some pass/fail criteria, i.e. if you were in the middle of some transaction when the error occurred it should not finish successfully resulting in missing expected entry in the web page (or database), so you can conditionally fail relevant sampler(s) in this case. See How to Use JMeter Assertions in Three Easy Steps to learn more about the concept.
Alternatively you can use WebDriver Sampler plugin which provides JMeter integration with Selenium browser automation framework which drives a real browser, so you will be able to capture this popups and record the page titles/take screenshots, check out IsAlertPresent() class for more information.
you must get this error response in your jmeter request response.simple answer.Have a regex to extract.

Not getting proper response in the tree table after performing login scenario using JMeter

I just started to use JMeter with the tutorial (for a sample website), which returns clear response data.
But, when I started to use in one of my projects, I saw the response was encrypted in View results in tree.
So can anyone provide solution for it? This was the response i was getting
I doubt you haven't check marked 'Use this proxy server for all protocols' while creating manual proxy configuration. By checking/ ticking that check box it will allow you to record the scenarios and also it gives you a proper response.
and I also doubt that you are getting proper server name. By doing the above step it will solve your problem

Data entry through Jmeter not reflected in UI of application

I'm using Jmeter to perform load test on Moodle application
I followed the below steps to replicate a simple "add company " test scenario
1: Recorded the browser actions through HTTP Test script recorder and created a test plan with thread user of 1
2: Added HTTP Cache Manager,Added regular expression extractor for retrieving dynamically generated session for login HTTP request.
For Http request of adding new company, addded user parameters containing new company name
I run the test, everything seems ok in the view results tree- response section (response code: 200,response message:OK), all the required variables are passed in the HTTP POST
PROBLEM: New company added through Jmeter test is not reflected in UI of the moodle action
Can any of you please let me know
Is there something I could be missing or anyway I can debug the problem?
P.S: I'm new to Jmeter and looked around a lot for data inputted through Jmeter not being displayed in the UI of the web application,dint find useful results.
The answer to questions of this sort is almost always that you missed some necessary dynamic value besides session ID which you did catch.
An HTTP200 response just means the server returned a "good" response. Which could also happily contain an error message.
I would check the actual html body of the returned response for any errors. Checking the log on the server side can give you clues to what went wrong sometimes. You should also try adding a cookie manager.
Run your test with 1 virtual user in GUI mode with View Results Tree listener enabled and inspect responses to see where your scripts fails. My expectation is that you simply cannot log in.
See Moodle-JMeter-LoadTest.jmx file for reference, it uses XPath Extractor to get session key and course id.
I don't think you can test using JMeter. Try JUnit Test cases instead http://jakarta.apache.org/jmeter/usermanual/junitsampler_tutorial.pdf

Resources