JMeter - Can't click on the body data tab - jmeter

Apache JMeter 5.4.1: I can't click on the body data tab. how can I do this?

JMeter doesn't allow to define both Parameters (under Send Parameters With the Request) and Body Data, you must delete all data before use different option
Note that once you leave the Tree node, you cannot switch back to the parameter tab unless you clear the Body Data tab from its data
You can add to Files Upload tab files while having either parameters or body

The process of clicking on the "Body Data" tab is very complex, so please read below instructions very carefully, you will need to:
Hover your mouse cursor over the "Body Data" tab of the HTTP Request sampler
Perform left mouse click (or equivalent for your operating system)
Note that if you have something in the "Parameters" tab - you won't be able to use Body Data or vice versa so you need to choose one of these options.
Demo:
If you're not too comfortable with building JMeter's HTTP Request samplers manually it might be a better idea considering recording your test scenario using JMeter's HTTP(S) Test Script Recorder or JMeter Chrome Extension

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

alternate option for window object in jmeter

When we try to encrypt and decrypt the application for front end request and response data,
Window object is not getting support in Jmeter.
As it generate 2 session id .
Kindly let us know any method in Groovy to support .
Window object is specific to the browser
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).
So there is no equivalent in any language supported by JMeter's JSR223 Test Elements
The options are in:
Use WebDriver Sampler for getting the session IDs you're looking for, they can be passed later on to "normal" HTTP Request samplers (but this way each JMeter virtual user will kick off a real browser instance)
Extract the code responsible for request encryption and session ID generation using browser developer tools and convert it to something JMeter could execute (remove the browser context), preferably in Groovy as it's the most performing scripting option

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

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.

JMeter - link clicking to generate a username

Sorry if this has been answered already, i tried to search but could get the exact information i am after.
The issue:
I am using JMeter to run some tests on a web application, as part of one of the flow, I under a first and surname in 2 input fields and i have link (Get userid) on clicking on the link the system will generate a user name. The user name is made up of first 4 letters from surname and first letter from the firsname and number at the end example: firstname is Test and surname is Environment, on clicking the get user id link the username will be generated as 'envit1' if 'envit1' is already existing then it would generated 'envirt2'
How do I simulate the click which generates the userid using jMeter.
Apologies but I am fairly new with JMeter, please ask if you need more infomratmation.
Many thanks in advance, Kay
If you're new to JMeter the best way to get things done is recording your user ID generation steps using one of the following approaches:
JMeter bundled HTTP(S) Test Script Recorder which acts like a browser proxy
A Google Chrome Extension which is capable of recording JMeter .jmx scripts right from your browser.
You can see what requests are being sent and HTML responses using handy View Results Tree listener.
However if clicking on link isn't being recorded, it's being handled by client-side Javascript. JMeter is not a browser and isn't capable of executing Javascript so you'll have to use WebDriver Sampler as Releasematic suggests.
You can use WebDriver Sampler but in each iteration it opens browser which may increase RAM usage. There is another option is to generate user id by running JS code in "JSR223 Sampler". With JSR223 Sampler you can run JS code but can't get access to DOM, so such JS code won't work:
function () {document.getElementById("edit-buttons-cleanup").click();};
You can install the plugin pack for the JMeter WebDriver sampler. Then, using some Javascript commands, you can start either a Firefox or a headless HTMLUnit and operate upon a webpage in a Jmeter step.

JMeter is not able to record and play "Checkbox" in webpage properly

In one of my performance test scenario, user has to select one check box and then click on save button , I am able to record the scenario but unable to play. Steps are as follows:
Log in to the application
Go to Page 1 and click on any “Check box” and then click on save button.
For one user script was able to record but while running for multiple users I found that script is not checking the “Check box”. Does any body has any clue on this ?
Jmeter DOES NOT support Javascript.
As per Jmeter FAQ:
JMeter does not process Javascript or applets embedded in HTML pages.
. . . 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.
JMeter is a tool for testing server code, not the client one. Both
recording and playback happens at the HTTP layer.
What you can do in your case is:
use any traffic inspector tool to record http request (upon "Save");
analyze request and its parameters sent;
setup request manually in jmeter.
Check/unchecking check box in your scenario doesn't generate any traffic itself BUT sets the value of request parameter sent along with further http request upon further "Save".
You have to set value of this param manually to the value which is equivalent to "checked" state of check box.
Jmeter does not recognise the elements written in javascript.
Try this:
Open Blazemeter
Go to advanced options
Select Cookies and Javascript Option under Request to Record
This solution worked for me.

Resources