Very new to JMeter and I've just written a script that will test enquiry forms on our sites. Each site has its own thread and the test for their enquiry forms is inside the corresponding thread.
Is there a way to send 1 email after the test has completed with the status of each thread group? i.e thread group 1 passed, thread group 2 passed, thread group 3 failed, thread group 4 passed etc.. The idea is that this script will run once a week automatically and if one of the sites has an error then I'll be notified.
Thanks in advance
Currently do you create some kind of report in any format?
If yes, JMeter has a SMTP sampler which you could use it in a tear down thread group to send the report to the given email addresses.
You mentioned that you run this periodically. If you use jenkins or other CI tools, that may be configured to send the results.
This might give some idea.
http://www.testautomationguru.com/jmeter-continuous-performance-testing-part2/
Related
I'm a Newbie in using JMeter tool and could not find a approach in JMeter to run End to end performance test of below use case:-
I have https webhook(Hosted on my node JS server) that is invoked on new device creation on Azure IotHub(Webhook subscription is done on Azure IotHub).
Once invoked, I parse the webhook(request) body and generate a unique token.
Once unique token generated, I set that token in the device configuration for which the webhook was called.(I get the deviceId in webhook body)
Once the device configuration set I return the response of webhook as 200.
Now, In JMeter how can I achieve step 1-4. My initial approach is to:-
Write python script to simulate new device creation on IoT hub.
After step 1 I'm not sure how will I capture the webhook invoked and response returned from webhook in JMeter.
Basically, Im not sure how I can successfully capture Step 2 and 4. Step 3 is basically the nodejs code for my webhook hosted on my server.
And I need to run step 2 and 4 200K times to measure the performance.
In summary, I have a script which registers device on cloud which triggers my webhook/api and I will calculate the response time in my script i.e. everything will be written in my script just that I want JMeter to show all the charts etc. based on the calculations I do in my script.And the script should be invoked n number of times as per the load required.
Any help in guiding me the approach would be very appreciated.
I have a solution for this now, in case anyone needs it.
Thread Group --> OS process sampler --> Response time graph
Above are the components I used in my JMeter tool. OS process sampler can run any script on your machine.
I am writing tests for an HTTP REST-like API. These tests are end-to-end tests, communicating with running application (web server, database, everything).
I am looking for a good way to test time based features. Since it is end-to-end test, I cannot simply mock time related functions.
As an example think about the google calendar.
Scenario: Event notification
Given it is 15:09
When I create new event starting at 15:20 with email notification 10 minutes in advance
Then I receive email notification within next 3 minutes
For single test I can just create on time and wait for email, but when I have repeated events (say weekly) than I need to test notification comes next week.
I was thinking about sending header that would (in dev environment) change application time, but the worker that sends notifications runs in separate process and would not be affected.
Hi i have created a thread group which contains 10 transaction controller, each control has multiple number of HTTP request samplers.
Now to identify the bottleneck as per the requirement, each transaction control has to run one after another.
For ex: 30 threads- Register and login. send reports and logout is the scenario.
so, For each action i have created 1 transaction controller which contains required http sampler request. First i need to run register for 30 users. after getting the response for all 30 users then only login transaction controller should run. and so on.. one by one.
I tried creating multiple thread groups but i am fetching security tokens in each group. So if i create multiple thread group i cant call variable values of one thread group in another.
So pls if anyone know the solution help me out, i am a beginner to jmeter...
This can be achieved using only 'Synchronizing Timer' element of the JMeter. Please find below the brief description of this element:
Synchronizing Timer: This element is used when you intentionally want to pause the users/threads at a specific step until the count of user mentioned in this element is reached
You can create your script in following structure:
Transaction Controller for Register requests
HTTP Register Request1
HTTP Register Request2
Transaction Controller for Login requests
HTTP Register Login1
Synchronizing Timer [Set the 'Number of Simulated Users to Group by' to 30 and Timeout based on your requirement [Recommended value to set is '300000' i.e 5 minutes]. Do not set Timeout to '0' otherwise your test will remain in running state forever if any of the user gets failed in previous step]
HTTP Register Login2
HTTP Register Login3
Note: In above example, you can see I have added synchronizing timer as a child of first HTTP sampler request of under Login transaction controller.
When the test reach at 'HTTP Register Login1' then before sending this request, it will perform the synchronizing timer and wait for all the users to complete the register action.
For beginners, the following blog posts of RedLine13 are very useful to jump start on JMeter:
https://www.redline13.com/blog/kb/
Also, the response time will definitely increase when you use the synchronizing timer because this timer will pause the test until all user reached the step and then perform the login operation. As all 30 users will perform the login action at the same time so the response time will go high as compared to the case when some users are doing registration and others doing login.
Kindly let me know if you have any questions.
If you want "login" transaction to be kicked off only when all 30 users completed "register" transaction you need to:
Add Test Action sampler between "register" and "login" transaction controllers
Add a Synchronizing Timer as a child of the Test Action sampler and set Number of Simultaneous Users to Group by to 30
This way Test Action sampler will act as a "rendezvous point" so all 30 threads will "meet" there, this way you will get confidence that all 30 threads completed registration prior to starting logging in.
Example test plan:
I am very new to Jmeter and need to perform a load testing of one SOAP request with 100 Authentication data. I tried the below approach, where I saved the authentication data in CSV file, using CSV Data Config parameterised and passed onto HTTP Authorisation Manager. I am able to sequentially test the SOAP request with all the user authentication data available in CSV, but I need to run concurrently, with all the 100 users. Thanks in advance.
I have 5 users authentication(username/password) in csv file
Set your Number of Threads to 100, and the Loop Count to 1.
Number of Threads has to do with the number of concurrent users that get run.
Loop Count has to do with how many times a user actually does your script.
Note that if your ramp-up is slower than your script time, some users will finish before your test reaches its full concurrency. Check this question for use with the scheduler.
In order to make all the requests to fire at the same time you need to add Synchronizing Timer to your test plan.
Increase "Number of Threads" to 100 on Thread Group level
Add Synchronizing Timer as a child of the SOAP/XML-RPC Request
Set "Number of Simultaneous Users to Group by" to 100
Make sure that CSV Data Set Config has following configuration:
"Recycle on EOF?" - true
"Stop thread on EOF?" - false
Thanks everyone for the quick answer. With the synchronizing timer had to modify "Sharing mode" option to "Current Thread Group" in http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config.
In thread I have mentioned 2 thread means 2 users but when I run my test in listner it shows 16 Samples.
Why its behaving like this?
Please check the below attached image.
This is because you are using a Stepup thread group, which is used for Stress test. This thread group is time based so if you say hold 2 users for 5 seconds, it will keep 2 users active for that time frame irrespective of samples it has to create.
hope this will help.