Does Jmeter saves the randomly generated email id (pre-processor-user parameters) in the database - jmeter

I have used Jmeter's pre-processor 'user parameters'to generate random email ids to test singup api, able to susscefully generate and signin. However not able to see the randomly generated email id in the database (using mongoDB), it is not stored in the DB.
Does jmeter saves the email id in the DB?

By default JMeter doesn't store anything into the database. If your API sign-up process assumes storing email of the signing-up person to the database - something is wrong with your test scenario.
JMeter automatically considers HTTP Status Codes below 400 as successful, it doesn't do any checks of the response body so my expectation is that you are receiving pseudo-successful responses having errors or exceptions inside. Add View Results Tree listener to your Test Plan - it is capable of visualizing request and response details and inspect them carefully. If there are errors - fix them until you will be happy with your script behavior, after that the listener can be disabled.
You can also use JMeter Assertions, i.e. Response Assertion to validate whether response contains message regarding successful sign up.
Don't forget to add HTTP Header Manager to send the relevant Content-Type header as some API servers don't process the requests not having expected MIME type.
See Testing SOAP/REST Web Services Using JMeter article for more information on APIs load testing.

Related

performance testing using jmeter cross checking the response with web data does not match

I have a web service URL:
https://app.snapmed.no/landing-page?flow=chat
The response code is 200 and the response body does not contain any valid data to cross-check with the webpage response or data in chrome It is completely dynamic. Now I do not know a enter image description hereway to add response assertion for this type of response. can someone help me?
Actually you don't have to use assertions, as per Reducing resource requirements chapter of JMeter Best Practices
Use as few Assertions as possible
JMeter automatically checks HTTP Response status codes and marks the HTTP Request sampler as failed if response code is 400 or higher.
If you want to add an extra layer of check you can explicitly validate that the page returns the HTTP Status Code 200 as follows:
also as far as I can see the web page always contains Send bilder til hudlege text so you can validate it as well:
More information: How to Use JMeter Assertions in Three Easy Steps

Jmeter login script

I am using Jmeter for testng load balance of website.I written a script to test the scenario like to make the user to login into the website and able navigate the user to the dashboard where he can see the recent data by consuming the protected calls.Here i am able to pass the user login scenario but the jmeter showing fail errors regarding the protected calls.When i am searching the url thing whcih is given by jmeter i able to understand that teh protected calls need user credentials to consume data but it fails due to absence of user login things.
Here i am able to pass the user login scenario
are you sure? If JMeter reports the HTTP Request sampler as successful it doesn't necessarily mean that the login will be successful, it might be the case your application responds with status code 200 and some error message explaining why the login has failed and JMeter automatically treats HTTP Status Codes below 400 as successful.
Try inspecting request and response details using View Results Tree listener which has HTML and Browser modes and double check that you're able to login.
If yes - you might need to add HTTP Cookie Manager or perform the correlation of the authorization header in the HTTP Header Manager for the "protected calls" or something like this
If no - you will need to amend your script so login will be successful. In order to avoid such situations in future you might want to add Assertions to your test plan to ensure that JMeter is doing what it's supposed to be doing

Apache Jmeter is not giving any error even we gave wrong credentials

I am new to JMeter. I am using it for load testing for Microstrategy web dossiers. I am loading the users from CSV Config file. I have generated steps using Badboy software and exported as Jmeter file. I have added variables for userID and password. I have enabled "Retrieve all Embedded Resources". When I ran the testing. I observed that its giving same response even if password is wrong. taskProcs are giving connection closed error. I have searched with dossier ID in both the cases , I am able to see the request and response same even if password is wrong. Can you help me how to identify whether the credentials matched or not ? I would like to throw error when password didn't match ? I thought of adding Response Assertions but responses are same.
JMeter automatically treats HTTP Response Status codes below 400 as successful. So if HTTP Request sampler returns status 200 (or any other between 100 and 399) it's treated as success.
JMeter doesn't perform any checks for content, if you need to add explicit pass/fail criteria basing on the response body, presence or absence of certain text, sampler execution time, etc. you need to add a relevant Assertion and put the anticipated success criteria into the assertion.
First JMeter doesn't generate any error codes or error messages itself, what it actually do is working as client and giving back what application sends to JMeter.
I think first you have to make sure application works correctly, then check whether Jmeter scripts work correctly. For that add debug sampler before the API request and check whether variables username, password has evaluated correctly from the csv.

1.wrong credentials is running pass in data driven-Jmeter

jmeter reads credentials from CSV. even if I have wrong credentials in the csv file (1/5login credentials) script shows successful.Does it check database while running? Which means 2 credentials is wrong, it supposed to shows fail, but it shows pass result(app angular JS type)
In the CSV file, I have 5 credentials and threads also 5...but in the output I got only 4 results
JMeter neither checks response nor database. In case of web applications JMeter automatically treads HTTP response codes < 400 as successful so if your web server responded with HTTP Status Code 200 (OK) - you will have "green" result even if your login wasn't successful.
You might wish to add i.e. Response Assertion to your request to ensure that response doesn't contain error messages or contain something, which indicates a logged in user, i.e. "Welcome" text or whatever.
See How to Use JMeter Assertions in Three Easy Steps article for more information on conditionally failing JMeter samplers.

Jmeter- Unable to understand result for the workflow

My website workflow is as follows:
User Name-->Password-->Click on login button-->Click on Report menu(Daily Transaction)--->Select date and device in report-->Click on Generate button.
Now I want to check load testing for this scenario that if multiple users gets logged in and access the reports, how my website will act?
I have created csv file for multiple user login with report data. But not able to understand the output coming. It is displaying Login request twice i.e. Login request and under daily report request it is again displaying login request. I have created Login request and report request separately.
In result I am not getting why it is displaying login request again under daily report request.
I believe that it is due to 1st login request failure as daily report request is not available for non-authenticated user. I would recommend taking the following steps to resolve your issue:
Add a HTTP Cookie Manager to your Test Plan. It will automatically care about handling cookies and hopefully will be enough to let you to proceed.
If not - record your login request several times and inspect recorded requests to see if there are any differences. If they are - you'll need to provide some mandatory dynamic parameter along with credentials. In that case test Scenario skeleton will look as follows:
GET request to Login Page
Extract dynamic parameter value
POST request to Login Page providing username, password and dynamic parameter name/value pair
See ASP.NET Login Testing with JMeter guide for more details on dynamic parameters extraction and usage bits, even if your application is not ASP.NET based it should still give you a clue on what needs to be done.
If you are using Transaction Controllers this can yield misleading results like you are seeing.
For example, take the following:
Transaction Controller - Name "Login"
HTTP Sample - Name "Login"
If "Generate Parent Sample" is selected on the transaction controller, you will only see the Transaction Controller in your results. If this option is not selected, you will see both the HTTP Sample AND the Transaction Controller in the result set.
Also, please note that the "Parent Sample" time is recorded as the TOTAL time taken to do all requests in the transaction end to end!! In almost all cases this reports inaccurate times because a real web environment has asynchronous calls.
For this reason it is strongly encouraged to avoid transaction controllers. In one case you report end-to-end time for all samples which is incorrect, and the other alternative is to report the transaction controller AND the sub-samples, which in turn makes your test report the incorrect rate of transactions.

Resources