I create Thread group , increase the threads to 10 , and use cookie manager in order to get different session while requesting web service , but every time i send same POST parameter to web service , but i want to provide different post parameter in each request to my web service through Jmeter . is it possible ?
Most commonly people use CSV Data Set Config for JMeter tests parameterisation. The idea is the following:
You have a CSV file containing the list of parameters you want to send
You add a CSV Data Set Config to your test plan and configure path to your file and output variable name(s), for example parameter
In the HTTP Request sampler substitute hard-coded request parameter with the variable from the CSV file like ${parameter}
Now when you run your JMeter test each thread (virtual user) will pick the next line from CSV file on each iteration so all HTTP Requests will be different.
References:
JMeter Functions and Variables
Using CSV DATA SET CONFIG
Related
In the site i have a fields like productName, productDescription, productId, Quantity. I need to write the script for the fields in jmeter. It has to the ability to write and edit the data automatically at the time of testing. Need solution for this problem
Thanks in advance
Explored for solution didn't find anywhere need help to sort it.
JMeter doesn't "fill" or "edit" any "fields", it sends HTTP requests with the specified payload, waits for the response and measures the time in-between.
So you need to come up with a relevant HTTP Request definition by:
Either building it manually populating relevant fields of the HTTP Request sampler
Or recording it using JMeter's HTTP(S) Test Script Recorder or JMeter Chrome Extension
One you have request "skeleton" with recorded hard-coded values you can variabilize it, for example change the values in that way JMeter would read it from i.e. CSV file using CSV Data Set Config so each virtual user would use new set of values on each iteration
I have a jmeter scenario where I need to upload a txt file of different size . To upload the file in jmeter , we enable multipart and request is of PUT type.
I am also getting put body , which is creating issue in my log files in the backend . Posting a sample request body . Is there any way where we can just send data without any data showing up under put data .
According to your screenshot you're trying to upload a file to http://www.csm-testcenter.org/test page, the page assumes HTTP POST method, not PUT.
If you're uncertain regarding proper JMeter configuration when it comes to uploading files be informed that you can just record the file upload event using your favourite browser (or another application) and JMeter's HTTP(S) Test Script Recorder. All you need to do is to copy the file to "bin" folder of your JMeter installation, this way JMeter will be able to properly capture the request and generate the relevant HTTP Request sampler and HTTP Header Manager.
More information: Recording File Uploads with JMeter
I've recorded a set of requests from our app using Jmeter, our web service is designed so that everytime a user id (fb id) is sent to the server it will be treated as a user.
My recorded set of scripts have a "send files with request" option enabled and have a binary file(.binary) attached to it, I need to create a load test scenario where I can send requests with different user IDs to create multi-user scenario. What should I do to get this done? Will it be enough that I pass the user ids a parameter and get it done?
Since the request uses a post method with this binary file being send along, should I do something to pass values to the binary file?
Can someone show me an example as on how to implement this scenario.
The below mentioned steps will help you achieve the above scenario:
Do correlation for dynamic parameters
http://apache-jmeter.blogspot.com/2011/12/correlation-regular-expression.html
Use CSV for login credentials
http://ivetetecedor.com/how-to-use-a-csv-file-with-jmeter/
Add a Cookie Manager to your script
hope this will help
I am using IBM Security Directory Integrator, formerly known as IBM Tivoli Directory Integrator, and in the feed section I have one connector that is connecting to a MySQL Database and providing data from the database, I want the data from the MySQL database to be displayed on a web page using an HTTP Server connector, however none of the attributes in the WORK object are available as output for the HTTP Server connector. There is not much documentation on this platform and I would like to know how to Route the data from a Database Connector to an HTTP Server connector which will then display the data on a web page.
None of the Attributes in the WORK object are available to scripts in the DATA FLOW section.
You need to update your question a little to reflect exactly what you want to do. Do you
Want all the data from your SQL DB to be shown on every request that reaches your HTTP Server connector
Display a specific entry from the DB depending on some input parameter on the request that reaches the HTTP Server connector ?
A little background on the feed and data flow sections
In your feed section, you would normally have a connector in iterator mode that will go through a number of data entries from a source.
In your data flow section you will have a number of connectors/functions/scripts that do transformations on the data
Each data entry that gets returned from the Iterator connector in the feed section, will go through the transformations described in the data flow section. This is configurable by mapping certain data attributes (columns in DB, fields in CSV, attributes in ldap, http parameters in http requests) to attributes in the work entry.
Normally it is up to you to do something with the transformed data, as in write them to a file, DB, ldap server.Again what will be written is configurable in the output map of the connector you use where you map attributes of the work entry to output attributes for the connector you use.
Now, the HTTP Server connector in Server mode is a slightly more complex beast in that it needs to send back a response to the HTTP client so it contains both an input map and an output map. What happens is that the request is read , the data flow section is executed and then the HTTP Server connector instance itself returns a reply to the HTTP client. This is described in detail here http://www-01.ibm.com/support/knowledgecenter/?lang=en#!/SSCQGF_7.1.0/com.ibm.IBMDI.doc_7.1/referenceguide29.htm%23serverconnect2 so I will not go into so much details.
Your specific scenario
If assumption 1 above is correct, then probably SDI is not the best tool for this. Or at least not as you plan to use it, anyway. You can have one assembly line that reads the data from the DB and then a file connector in AddOnly mode in your data flow (using an XML parser ) that will append the data in a specified form to a file. Then you need to do this once, or periodically, and serve the static html/xml file via a normal HTTP server. If you ABSOLUTELY need to use SDI for this, read below for assumption 2.
If assumption 2 is correct, then you have your connectors in the wrong sections. The HTTP Server connector needs to be in the feed section as this is the connector that would be listening all the time for incoming connections and would return something in response. The exact nature/Data of the response is up to you to decide by the connectors you will include in the Data Flow section. If you want to return a specific entry depending on the parameters of the request, then you would have a JDBC connector in lookup mode and the link criteria would be built based on the parameters of the incoming request in the HTTP Server. Otherwise, you need to read all the DB entries using the JDBC connector in lookup mode and a generic SQL query (select * from .. ) and then iterate over all the entries with a for-each attibute connector. No matter what/how you do it you will end up with some information you need to return to the client. For that you will use the output map of the HTTP Server connector and map the http.body and http.status
I have several thousands of files, some of them contain HTTP request and some of them contain corresponding HTTP response. I want to create some script, which spawns hundreds/thousands of threads and each thread should take HTTP request, send it to the server and compare response from server with corresponding response file.
I'm not sure if I have to create custom sampler with configuration, or I can use existing pieces of JMeter functions to create one?
Also I was not able to find reliable documentation of how to extend JMeter with new Samplers. This one seems to be outdated: http://www.jajakarta.org/jmeter/1.7/en/extending/JMeter%20Extension%20Scenario.html
May be somebody could advice where I can find latest guide, covering creation of Samplers? For example, how to create Sampler which will take a directory as argument and iterate over every file in that directory, then make request/compare response and tell JMeter if that one was correctly processed by WEB server along with timings?
I think you should just use regulat JMeter scenario. Implement list of files with CSV Data Set, spawn some threads with this set with Thread Group. Each thread gets the name of the request/response files pair from CSV Data Set, uses HTTP/TCP sampler to send request and an Assertion (Response Assertion) to verify response.
MD5 assertion can be even faster way to check the response.