Jmeter load testing with multiple user credentials and form filling - performance

I am new in jmeter and I am doing r&nd on Jmeter. I have a scenario can you help me regarding this.
1.I have one login form and one details form. User can first do login and then he can fill details form.
2.I want to test this steps through jmeter.
3.But, I want to test multiple user can login together and can fill details form together at the same time.
4.So how can I pass both login and details csv at the same time In jmeter.
Please guide me. If any video or blog please share.

If you have 2 CSV files, one with credentials, other with the form data - just use 2 CSV Data Set Config elements and point them to different files
If you have more than 2 CSV files, i.e. first file has credentials and the name of the CSV file with details for each particular user, you won't be able to use 2nd CSV Data Set Config, you will have to go for __CSVRead() function like it's described in How to Pick Different CSV Files at JMeter Runtime article

Related

Generating websites urls in a loop on Jmeter

I have a task in which I want to generate random websites URL's in a loop. The websites should be working one's and authentic. Is there any library in j-meter that can generate and add URLs in a bulk
I don't think that this is something you can "generate", you can create a list of existing websites i.e. from Alexa or Big List of Websites.
You can even do it in JMeter, like:
In setUp Thread Group visit alexa or big list of websites
Extract the URLs using a suitable JMeter Post-Processor and write the required number of the websites to the .CSV file
In the main Thread Group you can read the URLs from the CSV file using CSV Data Set Config
Use the variable from the CSV data set config in the HTTP Request sampler

Csv or excel file upload

As part of my perfomance test i need to upload and submit excel/.csv files.
My flow is below.
1. Login
2. Create new account
3. Click on the upload button
4. Select excel or .csv file
5. Click on the submit button
I need to cover this using single jmeter script.
Please any one can help me.
Just record your test scenario using JMeter's HTTP(S) Test Script Recorder, the key points are:
Make sure to copy your csv/excel file(s) to "bin" folder of your JMeter installation - this way JMeter will be able to capture the upload request
Make sure to perform correlation of all dynamic parameters
Make sure to add HTTP Cookie Manager to your test plan
See Apache JMeter proxy Step-by-step guide for comprehensive information on configuring JMeter for recording.

NI-FI - Issue authenticating to a page to download a file

I'm currently trying to get a .zip file from a webpage using nifi to do it. I am able to generate a direct download link of the file but the application needs to log in into the page before opening the direct link. I've tried using InvokeHTTP, ListWebDAV and FetchWebDAV processors and I was not able to do this properly.
I even tried to add the login and the password as attributes using the same ID used by the page(logon, temp_password).
Also tried going for a Python code but I was not able to get any good results with it.
Every time I tried any of these methods I received a small file on the InvokeHTTP with the download link saying that authorization is required and it downloads a file that is the source code of the login page.
Tried to look in almost everyplace on the internet without much success :/
I'm now trying to get a processor to actually log into the page and keep it that way so the invoke processor can download the zip file using the direct link.
If somebody have another idea on how I can resolve this I will be very grateful.
I can provide more info if needed, at the moment I am using the Ni-Fi 1.1.2
Thanks in advance;
Depending on the authentication mechanism in place by the page, you'll likely need to chain two InvokeHTTP processors together. Assuming the first page has a form field you fill out with the username and password, you'll make one InvokeHTTP which uses the POST method to submit the form with the provided credentials and receives a response that contains some kind of token (session ID, etc.). You will extract this value (either from a response header or the page content), and provide it to the second InvokeHTTP as a request header. Using your browser's Developer Tools feature as daggett suggested to observe the authentication process will allow you to determine exactly where these values are provided.

Use EC2 for PDF Generation, provide public URL to user

I have developed an application which allows Users to select multiple "transactions"; each of this is directly related to a PDF file.
When a User multi-selects them, and "prints" them, these PDF files are merged into one longer file to provide ease of print.
Currently, "transaction" PDFs are generated on request, and so is PDF-merging.
I'm trying to scale this up relaying over Amazon infrastructure, some questions arised to me.
Should I implement a queue for the PDF generation per "transaction"? If so, how can I provide the user a seamless experience? We don't want them to "wait"
Can I use EC2 to generate these PDF files for me? If so, can I provide a "public" link for the user to download the file directly from Amazon, instead of using our resources.
Thanks a lot!
EDIT ---- More details
User inputs some information through a regular form
System generates a PDF per request, using the provided information for the document
The PDF generated by the system is kept under Amazon S3
We provide an API which allows you to "print" multiple pdfs at once, to do so, we merge the selected PDF files from S3, into one file for ease-of-print
When you multi-print documents, a new window is opened which is your merged file directly, user needs to wait around 20ish seconds for it to display.
We can to leverage the resources used to generate the PDFs onto Amazon infrastructure, but we need to keep the same flow, meaning, we should provide an instant public link to the User to download & print the files.
Based on your understanding, i think you just need your link to be created immediately right after user request for file. However, you want in parallel to create PDF merge. I have idea to do that based on my understanding, and may be it could work in your situations.
First start with some logic to create unique pdf file name, with random string representing name of file. And at same time in background generate PDF, but the name of PDF should be same as you created in first step. This will give user instant name of file with link to download. However, your file creation is still in progress.
Make sure, you use threads if using PHP or event loop if using Node.JS to run both steps at same time. This will avoid 404 error for file not found.
Transferring files from EC2 to S3 would also add latency delay. But if you want to preserve files for later or multiple use in future then S3 is good idea as it could simply serve PDF files for faster delivery. As we know S3 is used for static media storage. Otherwise simply compute everything and generate files on EC2

How record multiple website Action

How record multiple website Action
I have a one master company and have a multiple slave company so, I want to record all action for all website for one test plan
You can record multiple URLs in the same test plan. Assume that you want to record below three websites.
http://example1.com
http://example2.com
http://example3.com
In JMeter
Create three loop controllers (or any controllers of your choice) in your test plan as shown below.
Before you start recording http://example1.com, go to Recording Controller and select the Example1 controller as shown below.
Start your recording.
Once you are done with the recording of http://example1.com, go back to JMeter and change the controller to Example 2 and repeat the above steps.
Ditto for Example 3 as well.
In this way, you can multiple URLs within the same test plan.
Alternate Method
Another simpler way is to use Blazemeter Chrome Addon to record JMeter tests. Install the addon in Chrome browser and simply record your flow across multiple URLs. While exporting you can check which URLs to include/exclude.

Resources