Jmeter Issue: # is getting replaced by %40 when trying to read data from CSV - performance

I have a scenario where I want to read the data from CSV file and use the same in a POST request. The email data contains '#' symbol.
So, when I try to hit the API using Jmeter '#' is getting replaced by '%40'. I tried below solutions but it didn't worked out:
Uncheck 'URL Encode' checkbox
Used __urldecode function -> ${__urldecode(abc#xyz.com)}
Result:

I don't think JMeter converts anything, it should send POST request parameters as they are, what you see in the View Results Tree listener is the textual representation. You can use a sniffer tool like Wireshark to see what exactly JMeter sends:
If you switch to HTTP tab you should see that the username is sent with # symbol
If you have troubles building your HTTP requests manually consider recording just recording the request(s) using either HTTP(S) Test Script Recorder or JMeter Chrome Extension, both should produce syntactically correct HTTP Request samplers.

Related

Facing issues in __eventvalidation and __viewstate in jmeter

i have a scenario, as given below
once the user navigating to planning page and
clicks on a menu,
it will open the lists of recipes in week wise.
if the users wants to add a recipe for a particular, it has an option to click on '+', which will open a popup window which has all the recipe details available.
I have recorded the scenario using JMeter and it has the dynamic values like __VIEWSTATE and ___EVENTVALIDATION etc., and correlated them as well.
But at the 4th step, in the jmeter instead of proper response body and the below message is displayed.
1|#||4|137|pageRedirect||%2fPerfTesting%2fError.aspx%3faspxerrorpath%3d%2fPerfTesting%2ffi-FI%2fDefault%2fKAXXILA%2fPlanning%2fPlanningMenuWeekView.aspx|
Any suggests
Make sure to add HTTP Cookie Manager to your Test Plan
Make sure that your correlation really works, i.e.
associated JMeter Variables are there
they have correct values (like you extracted the dynamic parameter fully)
depending on your application and extra step might be required like URL-encoding the parameter or vice versa
You can use Debug Sampler and View Results Tree listener combination in order to check these variables
Use an external sniffer tool like Wireshark or Fiddler to capture the requests from JMeter and the real browser, the requests must be exactly the same including:
URL
Headers
Request body
all the dynamic parameters must be properly correlated. Given you will send the same request you should get the same response

Bad Encoding or Strange Characters in Jmeter HTTP Request POST Option

I have been trying to record session and I got some "bizarre" characters in the POST Option in the HTTP Request component. I need some MAGIC Advice with this(picture).
Stranges Characters Appear in the POST Option in the HTTP Request component
That's it, as you can see, Jmeter in the recorded session, put me Characters that I don't understand. I seen 1000000 videos and in all of those videos the tool always show the information with no problems.
I alreade try to put utf-8 in the "Content Encoding" also change the jmeter.properties file enabling the "sampleresult.default.encoding=utf-8" option, In FACT, I try to edit the proyect modifying the ApacheJMeter_http.jar file (I found in the file that still using encoding=ISO-8859-1). I dig in almost all sites looking for a solution and I found NOTHING that can help me to fix this and I have to buils a report for my jobs next week. Please any help will be appreciated.
my Best
PG
Switching to "Parameters" tab of the HTTP Request sampler will not work given you have something in the "Body Data" tab no matter which "encoding" is being used
I don't think your goal is to test https://ocsp.digicert.com/, my expectation is that you need to exclude this domain from your testing scope
Just in case you don't need to recompile or reverse engineer anything, the "encoding" of JMeter HTTP Request samplers can be controlled either using the relevant field:
or by manipulating the relevant JMeter Properties

Encoding value Jmeter

I have one problem with enconding variable in Jmeter.
I extract value from previosly response body and save to the value,
defined such as https://i.stack.imgur.com/fvyWE.png.
sigAlg: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
According during using next POST method request JMETER code special characters such like as %,/
enter image description here
I cannot reproduce your issue using "Body Data" tab of the HTTP Request sampler, if your setup is different - make sure not to check URL Encode? box next to the parameter name.
For the future: if you have doubts regarding proper configuration of the HTTP Request sampler - the easiest solution would be just recording the request from your browser using JMeter's HTTP(S) Test Script Recorder or JMeter Chrome Extension

JMeter leaving protocol in HTTP request sampler empty

I'm using JMeter v3.2 and I put up a really simple test plan for testing something. I have a csv file where I save all URLs acquired by a crawler. The URLs are just normal (http://something.com).
After reading those in from the CSV Config and writing them into my HTTP request sampler I get the following issue. The problem comes with the default protocol of JMeter which turns my request URL into this:
GET http://[http://something.com/]/.
Is there a way to turn that off?
Never put anything but ip address or hostname into Server Name or IP input of the HTTP Request sampler.
If you are getting the whole URL from CSV file - use Path input instead like:
Demo (as per View Results Tree listener)
See Using CSV DATA SET CONFIG guide to learn more about parameterisation of your JMeter test with CSV files.

Jmeter: Issue with Response Data (HTML) and Is my script Functional?

I am using Jmeter(2.3.2) to create script for one of my application with a scenario which has flow for 4 to 5 pages. I have recorded the script using HTTP Proxy Server. The scripts has been generated successfully under Thread Group >> Recording Controller.
After running the scripts (Threads- 1, Ramp Up period - 1, Loop Count - 1 ), below are the observations I noted in View Results Tree:
The Result Tree view shows all as Checked(Green) - OK
The Sample result for all screens shows Error Count as 0 - OK
But in the response tab when I try to view the results by using 'Render Html' response data - the response data shows the same response for all the requests.
I am getting the response data of the first request for all the other requests.
I am not sure, whether the Jmeter script generated is functional or not? What is the cause for getting the same response data for all the requests?
Please, can anyone let me know what may the issue?
I bet that the same page you're observing is a kind of login page or dashboard which is accessible by unauthenticated user.
First of all make sure that you have HTTP Cookie Manager added to your test plan. It represents browser cookies and deals with user sessions and cookie-based authentication.
If it doesn't resolve your issue the problem is bigger and you will need to do some extra stuff. Modern web applications use multiple mechanisms of current state of things storing and managing, security enhancements and so on. From JMeter's point of view it results in dynamic mandatory parameters. The process of these dynamic parameters extraction from previous request and adding them to next request is called "correlation". So you need to do the following:
Detect which parameters being sent by a recorded script are dynamic. The easiest way is to record the same scenario several times and inspect request bodies to see what is being static and what changes.
Once you figure out which parameters are "interesting" you need to locate them in the first response body/headers/etc.
As soon as you have identified what necessary parameters are and where they live you need to use one of JMeter's PostProcessors to extract required values from previous response and save them to JMeter Variables
Once you have a JMeter Variable it can be used wherever required.
Depending on response data type the most commonly used JMeter's Post Processors which provide correlation capabilities are:
Regular Expression Extractor - the most commonly used test element which covers >90% of needs.
XPath Extractor - better to use against XML data i.e. for testing SOAP Web Services.
CSS/JQuery Extractor - when you need to fetch something from complex HTML where Regular Expression Extractor is useless.
So for putting everything together loog for "jmeter correlation" in your favorite search engine or see ASP.NET Login Testing with JMeter guide.
First JMeter 2.3.2 is WAY TOO OLD (10 years old), upgrade to JMETER 2.11.
Second, Jmeter cannot guess that the response if KO if the returned code is 200, so you need to add Response Assertion that will check for some text you expect in the page.

Resources