JMeter Script issue - jmeter

I am new to JMeter. I have taken up HP webtour(127.0.0.1/WebTours) for practicing.
I recorded a scenario for flight booking. I correlated the session ids and found the script was working fine( i was able to see correct HTML pages in View Result Tree).
So, ideally if i run the script a flight should be booked and when i check the application manually i should see a flight but this isn't happening. I run the script,it goes fine but i dont see a flight booked. I have tried to correlate dynamic values and don't see any pending value which isn't been handled.
Any idea on this.

Make sure that you double check the post request were the flight is booked. Because JMeter will put a green if it gets a response with status 200, but it is our responsibly to make sure that we have got the appropriate page. 'Response Assertion' can help you in doing it.

Related

I need to see the time taken by certain APIs in the test plan in jmeter

There are multiple requests in the test plan created for ride booking process. I need to find the time taken between the login and the ride booking apis .Is there a way wherein I can get these details in the test plan automatically without any manual intervention?
Most probably you're looking for the Transaction Controller, it generates synthetic Sample Result with the response time which is the sum of all its children
More information: What is JMeter’s Transaction Controller?

Less Data is getting inserted database after running Jmeter script

I recorded .jmx script by recording Blazemeter tool.
I followed below steps:
Login into application.
By default user landed on page which is Search Page where Patient list is displayed.
Now I select Patient and Navigate to Flowsheet page by clicking on HD Flowsheet menu button. Patient selection is mandatory.
Saved Flowsheet.
Logged Out.
Thread Group Detail:
Action to be taken after a Sample error: Continue
Number of Threads(users): 10
Ramp-up period (seconds): 100
Loop Count: 1
Same User on each Iteration : Yes
After executing script with above Thread group, In database only 6 Flowsheet is getting inserted instead of 10 flowsheet.
I checked View Result Tree, It is showing no error and also in Summary report it is showing 0% error.
What can be root cause? What strategy I should follow in such cases to debug script?
JMeter automatically treats HTTP response status codes below 400 as successful, it won't do any extra checks for the "flowshit" creation or insertion simply because it doesn't know anything about it.
My expectation is that your test silently fails somewhere, add View Results Tree listener and inspect response details for each step, most probably you will see that either you're submitting the same flowsheet over and over again or your script got stuck somewhere.
If you want to add an extra layer of verification, i.e. ensure that response contains specific value, you can add a Response Assertion to each request and specify pass/fail criteria there
In general when it comes to modern web applications the chance you will be able to successfully replay recorded script is close to zero because there are multiple dynamic parameters involved like ID of the patient or flowsheet, cookies, tokens, etc. and these dynamic values need to be correlated

JMeter - How to obtain error rate per page on a specific timeframe

I have been looking on the site and I don't see anything related to this topic, so I decided to ask.
Basically, I would like to know if there is a way to extract the error rate per page using a period of time. The reason is because we run a test in different stages, with different levels of throughput. Therefore, I am interested in obtain the degradation on page health. I already got the hits and response times. However, the error rate I don't see a way to get it.
If someone knows a way, please share!
Thank you in advance guys!
You can use the jp#gc - Hits per Second - listener. Just click on Errors check box to show only the failed requests which is the Error rate you are looking for!
For page level Error rate, you can jp#gc - Transactions per Second
You have the following options:
Response Codes Per Second chart available via HTML Reporting Dashboard
Response Codes Per Second chart available via JMeter Plugins
Use 3-rd party analysis solution like BM.Sense

Why jMeter show transaction controller data in its summary report?

Here i have A recording controller and test script recorder. I recorded the user activities using template. This automatically creates a Recording controller and then transaction controller. Each transaction controller has child HTTP request wrapped inside it. Now when I run the test after creating a test script, I see that the aggregated result shows information about (throuput, error, min etc) for child HTTP request(Sampler) as well as the parent transaction controller.
I'll make it more clearer with images below.
In the above picture ive created the test plan. Now when I run this test i get following result. The circled ones are the transaction controller.
Here, i have circled the parent transaction controller. Now why on earth is this adding up to the result.
Question: Is it making any request to the website? Why is this showing up and adding values to the child request. This thing is just a sum of all its child request - so, why is it adding up in the table?
Here again if I click on the "Generate parent sample" then it hides the child request and shows only the summed up report which is totally different from above report.
Now the question is how do I turn things around. What are the consequences. And what should I do in this case. Shall i compute the parent-child report or just the parent report data?
As per documentation of Transaction Controller:
The Transaction Controller generates an additional sample which measures the overall time taken to perform the nested test elements.
So if you don't want this additional sampler, just remove it or replace it by Simple Controller.
Note it is useful when it contains more than 1 sampler.
If you're looking to learn jmeter correctly, this book will help you.

How to end "While Controller" on error and show whole progress in "View Results Tree"

In my test plan I want to make java request and check how it was done by making jdbc request, But I don't exactly know when java request will change DB. I want to make several requests with waiting after each. And if JDBC request doesn't special changes after certain time stop whole test. After that I want to see progress where test plan stopped in view results tree.
BUT
If I use any stop-thread functions, there are no data in View Results Tree.
Haw can I do what I want with jmeter?
Thanks.
you can use a similar mechanism to the one described here:
http://www.sourcepole.ch/2011/1/4/waiting-for-a-page-change-in-jmeter

Resources