How to click a button on pop uo URL in jmeter without recording the script so that a data can be saved in the application - jmeter

i have a web application which has confirmation pop up to save a record . i have used post on the HTTP request sampler and used parameter body , but still the record is not getting saved in the web application using jmeter . i have to click save then yes on the confirmation pop up

JMeter doesn't actually perform "clicks", it sends HTTP Requests, in your case this "popup" seems to be used for populating the USER_COMMENT section:
with regards to "record is not getting saved in the web application" - it indicates that your script fails somewhere somehow, you should inspect response details using View Results Tree listener, it might be the case the application will tell you what's wrong with your request.
The most common reasons are:
Your login request fails hence all subsequent requests are landing at the login page. JMeter automatically treats HTTP status codes below 400 as successful therefore you can see them as "green" or false-positive so check that all previous responses return expected data using the aforementioned View Results Tree listener
The request may fail due to missing or improperly implemented correlation, i.e. you're updating the record which was created during recording instead of adding a new one

Related

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

How to save cookies in jmeter recording and replay

Here i have two questions regarding capturing the cookies through JMeter. I am using JMeter recording to capture the web browser flow . And i have added Cookies Manager under the Test plan (common for all requests) Below is my flow :
launch >select Providers >sign-In
While recording it is capturing the cookies properly . i am able to see in the "Request Data" in "View Results Tree" . But while trying to replay i am not seeing the cookies in the results.
Please let me know if i am missing some settings here.
How this will work when we increase the no of users and run.
Thanks In Advance.
JMeter doesn't record cookies, if you add HTTP Cookie Manager to your Test Plan it will automatically extract the cookies from the application's Set-Cookie response header, parse them, validate and send with Cookie header during the next request.
If you cannot see any cookies the reasons could be in:
Cookies are invalid (i.e. expired, not matching the domain/path)
Your test fails somewhere somehow, i.e. your sign-in request fails because you haven't implemented correlation of the dynamic parameters
Inspect response details using "Response Data" tab of the View Results Tree listener and ensure that your test is doing what it is supposed to be doing as it looks like it doesn't go further than first page in your case

Same POST works manually, results in 500 error via Jmeter

In my script, I'm using a JSESSIONID instead of a cookie; the JSESSIONID is extracted using a HTTP URL Re-writing Modifier and I can confirm that the correct value (the one which appears in the response data from the login page) is being applied in the Request.
e.g. POST https://qa67.ososinfo.org:446/Staff/staffdetail.xhtml;JSESSIONID=0655ca5420354753ae413984d34cfc27
I'm also using a VIEWSTATE, which I'm extracting prior to running the remainder of the test steps by using a Regular Expression Extractor and setting the resulting variable as a parameter in the HTTP Request,
e.g. javax.faces.ViewState=8d2%2BgOIseczB2FWSo74DqQfkmiYVaK73D8bnLTNWCx%2FB8EtE
The problem is that I'm hitting a Response code: 500 | Response message: Internal Server Error every time I attempt a post with all of the applicable data.
I tried running through the steps manually in a Firefox browser. I copied the contents of the Request tab from the failing page into a REST client, logged in using a separate tab of the same browser and grabbed the appropriate JSESSIONID and VIEWSTATE information, then posted with that info in place - and the manual post was successful.
Am I missing something? Is JMeter requiring something to accomplish this POST that a I'm not seeing in a manual attempt? Please note that I can verify the test is working through the point of login - I can manually see the jmeter user logged in from an admin screen.
Happy to share any/all of what I'm seeing if it might be helpful in helping to troubleshoot.

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.

How JMeter tests web application

I made load test on my web application with JMeter using HTTP Proxy. In HTTP Request I insert some data which I want to change. After load test when I go to the web page the page was without changes and I get all results(graph and table). Is that test real or not? Because was without page (data) changes?
Use the "tree view" LISTENER to see what request you sent to your web application. That will tell you if Jmeter was sending the new data, or just sending what you recorded. If Jmeter sent new data, then your application probably has a problem. If Jmeter sent the old recorded data, then you need to update your script by going to the request and changing the parameters.

Resources