I want to fire multiple soap requests with different data through jmeter and I want all the soap requests to hit the application concurrently. Also I would like to know if I can do the same thing with soap ui? If possible do describe the steps in detail. Thanks in advance.
For JMeter:
Add HTTP Request sampler to your test plan
Add Switch to "Body Data" tab and put your XML payload skeleton there
Substitute the parts of the body you want to parameterise with JMeter Variables or Functions, the most commonly used for parameterisation test elements are:
CSV Data Set Config
__StringFromFile()
__FileToString()
__CSVRead()
For "concurrency" you also have different options:
If you want X threads to execute requests as fast as they can - just specify them in Thread Group
If you want X requests per second - go for Constant Throughput Timer
If you want all requests at exactly the same time - Synchronizing Timer
For SoapUI check out Simulating Different Types of Load article
Related
I am new to jMeter so hope you can help me out.
I have a thread group with several HTTP request samplers. I am sending an email every time any sampler fails. The thing is I would like to collect the names + response bodies of the several failed samplers to send in the email.
Can anybody please give an example of how to do it?
The best solution would be using Simple Data Writer listener configured to save only failed requests, there you can choose whatever metrics you need to store:
Another option is using JSR223 test elements and Groovy language to extract the "interesting" fields from the failed requests:
in the above example the sampler gets the label and the body from the previous result and stores them into ${requestName} and ${responseData} JMeter Variables which you can use wherever you want. More information on these prev, vars and other JMeter API shorthands: Top 8 JMeter Java Classes You Should Be Using with Groovy
I have an HTTP request which contains messages (json body). I need to achieve 1000 messages/sec throughout the load test. But I also need to randomize the number of messages (with different combinations like 100 messages in one HTTP Request, 200 and 300 etc.). Could anyone please let me know how can we achieve this in JMeter or Load Runner? My concern is that at any point, the maximum number of messages sent should not exceed 1000/sec.
To control message rate, you can use Throughput Shaping Timer
To send different type of messages you can use a CSV file and use component CSV DataSet to load it and read each line as a message into variable (let’s say you call it varName) which you can then use as ${varName} ad body of Http Request
1000 messages/sec throughout
LoadRunner - cannot be done (you can try to achieve this using Pacing but anyway it will mostly depend on your application response time)
JMeter - you can use one of the following:
Constant Throughput Timer
Throughput Shaping Timer
Precise Throughput Timer
Random number of messages in the request body payload: in both tools you will have to write some code for this, in LoadRunner you basically have to write the code for everything, in JMeter you can add JSR223 PreProcessor and use Groovy language for message payload creation
Not sure what a message means exactly in your requirement. But generally in LoadRunner you can create goal-oriented scenario and set the goal definition like average hits per second or average throughput (bytes/sec).
I have a load test plan in JMeter as follows:
Test Plan
|- Thread Group
|- BeanShell Sampler (CSV Read)
|- Loop Controller
|- Counter
|- HTTP Request${counter_value}
|- View Results Tree
Http requests are made depending on the csv lines read and that's the reason for the loop controller. When all the requests are made and go to the View Results Tree information I see that requests are made sequentially (HTTP Request1 first then HTTP Request2 and so on).
So, is there a way to do concurrent requests without using any external plugins or am I wrong about how concurrency is done when using a loop controller?
Loop counter wont create concurrent requests. From your question, it seems that you want change number of threads dynamically. Here are the related questions which may give you some perspective :-
Increase number of threads in JMeter during execution
Change the thread count of test plan in JMeter, at run time
You can use Synchronizing Timer to achieve concurrency.
Check the below links for more information.
How to Use the Parallel Controller in JMeter:-
https://www.blazemeter.com/blog/how-to-use-the-parallel-controller-in-jmeter/
How to Load Test AJAX/XHR Enabled Sites With JMeter:-
https://blazemeter.com/blog/how-load-test-ajaxxhr-enabled-sites-jmeter/
Hope this helps.
You cannot achieve concurrency by using Loop Controller, it can only be used for repeating its children.
The actual concurrency can be achieved by adding more threads (virtual users) on Thread Group level
Given above setup JMeter will start concurrent 10 users which will be executing requests for 60 seconds.
I would also recommend reconsidering using Beanshell Sampler, since JMeter 3.1 it's recommended to switch to JSR223 Test Elements and Groovy language. Moreover JMeter provides CSV Data Set Config and/or CSVRead() function which can be used for reading data from the external CSV files.
i have a issue with to many calls to the server.
I have extracted several urls with the "regex extractor".
In the next step, a "http request" calls these urls by ${extractet-urls}
But all requests after the 8th url gets a error 500 response from the server.
I tried to input several timers between, before and everywhere else, but it hasn't an impact.
So my question is:
how can i delay in this single http request which calls all the extracted urls?
Thanks for your help :)
After the requeat you can add sampler ->Java Request. Then change classname to SleepTest and it'll wait 1 second (configurable)
Add a Constant Timer as a child of the HTTP Request sampler (see Scoping Rules for details) and provide desired delay there (in milliseconds). It will cause the relevant thread to "sleep" for the defined amount of milliseconds before executing the HTTP Request. See A Comprehensive Guide to Using JMeter Timers to learn more about using Timers in JMeter tests.
Another option could be using Test Action sampler to create a delay, it doesn't generate sample result so you won't see it in .jtl results file.
The final approach is depending on what you're trying to achieve and how your test is designed.
Alternatively, you can add a Thread Group and define a ramp up time, then put the request inside this group. The ramp up time takes the startup overload too.
Need some help on Jmeter for the following scenario please I need to simulate these steps in order to load our application.
a) make a request to a web-service.(done)
b) verify the response for some variables and extract a URL address from the response.(done)
c) Now using the extracted URL need to make another request.(extraction done)
d) in response a media file will be sent.
My Plan consists of "stepping thread group-->(Sampler 1)HTTP Request +couple of listeners for data gathering--> (Sampler 2)HTTP Request +couple of listeners for data gathering. the issue is that when i ran the plan the first sampler generated 4 requests but the second one generated only 2 can you tell me why is it so.
In general how can i simulate all 4 steps in one go for a single thread. I hope that i have cleared myself.
In JMeter each thread runs requests sequentially already.
So in order to do what you expect you'll need to use:
Post Processors called extractors to extract data into variables
Variables to inject in the requests
Read:
https://jmeter.apache.org/usermanual/test_plan.html#postprocessors
https://jmeter.apache.org/usermanual/functions.html#functions