Generating websites urls in a loop on Jmeter - 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

Related

Is there a way to test web application with lot of dynamic content using JMeter

I am trying to test a web application once I login into the application in the response I see a lot of dynamic content getting loaded like java script files also I could see a lot of dynamic ids are generated on every run , I tried to handle few token/id using regex but still I see lot of id's on the login response
Is there any other way to test these kind of applications with lot of dynamic values
Any comments/suggestions would be greatly appreciated , thanks in advance
With regards to javascript, images, styles, fonts, sounds, etc. - JMeter can handle it automatically, just tick these boxes in the HTTP Request Defaults
also add HTTP Cache Manager to your Test Plan to simulate browser cache.
With regards to handling dynamic IDs - the process is called correlation and there are 3 options:
Handle each dynamic parameter manually using Post-Processors
Use Correlations Recorder Plugin for JMeter to apply extraction and substitution rules during recording
Use BlazeMeter Proxy Recorder which automatically detects and handles dynamic parameter

Jmeter load testing with multiple user credentials and form filling

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

How to sort/get desired URLs properly in WorkBench and Run it in TestPlan of JMeter?

I have to record and run Jmeter test using WorkBench so that I have recorded using Proxy[See the image].
Lists all the URLs
I know I can sort/get the urls by using 'URL Patterns to Include' option in HTTP(S) Test Script Recorder. When recording it lists out all the URLs including .gif, .png, .ico etc.
URL Patterns to Include
I have two doubts to clear.
When recording what is the criteria to give in 'URL Patterns to Include' - to record desired URLs only. (Desired URLs I meant is for example, if I am recording a website developed in PhP, I need all PhP links only. ie, home.com/index.php, home.com/contact.php, home.com/about.php). Now it records all the URLs where I cannot see the desired links. How to get .php or main link URLs(we see in browser URL)?
Regarding running a test in Test Plan contains the URLs that I have cut-paste from WorkBench(recorded using Proxy), do we need to add all the recorded URLs including .gif, .png, .ico etc or just add the specific URLs(say home.com/about.php) only? If I run using only the specific URLs, whether the result will be correct as we excluded other URLs like .gif, .png, .css etc ?
You don't need to record these .gif, .ico, etc. files separately as this is not how real browsers work.
Real browsers do main request to the HTTP endpoint followed by concurrent download of so called embedded resources: images, scripts, styles, etc. In order to make your JMeter test to behave more like a real browser you need to:
Exclude these requests from recording. Click "Add suggested excludes" button in the HTTP(S) Test Script Recorder (or even better re-record your test scenario using JMeter Recording Template feature)
You can create a recording test plan by selecting File -> Templates -> Recording -> Create from JMeter's main menu.
When it comes to test execution add HTTP Request Defaults to your Test Plan, switch to the "Advanced" tab and tick Retrieve All Embedded Resources and Parallel Downloads boxes
If there are images, banners, whatever coming from external servers you can filter them as well via URL(s) must match box in form of Perl-5 compatible regular expression.
See Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses article for more information on dealing with embedded resources in JMeter tests.

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.

Why do we exclude jpg,css file in jmeter script

I am just wondering why do we exclude photos and css files in jmeter script because if i think from end user prospective,images takes more time to load.
The only content to be excluded from test script is "external" content, i.e. any third-party banners, pictures, maps, analytics, etc. content needs to be filtered out.
JMeter test needs to be as much realistic as possible to correctly simulate user activity. So:
Images, scripts, styles, etc. do not need to be excluded from JMeter test
The best way to handle them is as Vinoth S suggests using "Retrieve All Embedded Resources" functionality (and it is also better to use concurrent pool of 2-4 threads for it). The most optimal way of configuring it is via HTTP Request Defaults config element so the change could be applied to all HTTP Request Samplers.
It is also good to add HTTP Cache Manager from "reality" perspective as real browsers download all this stuff like images, scripts and styles, but they do it only once, on subsequent requests the content is being returned from browser's cache and the actual request to the server is not being made.
See How to make JMeter behave more like a real browser guide for other recommendations on how to make your test more realistic.
css/jpg/js files are all embedded static resources in the HTML response you get.
so instead of sending a recorded request, you can select the below option in the HTTP sampler. JMeter will take care of downloading these files for you just like a real browser.

Resources