Skip to main content

Jmeter 5.4.1- Config Elements - Part-03

 


Part-01- Installation of Jmeter and HTTP's Recorder click here

Part 02--Previous blog on Assertion

Config elements in Jmeter are used to configure or modify the samplers requests made to the server. These elements are added at the same or higher level of the samplers that we want to configure 

Let' start with 

CSV data config

As the name suggest it used to read data from CSV first we need to put data in variables and then use the variables in sampler request.

create a new test plan add CSV data set config

Add a Thread Group and then add Sampler "Java Request" 

Create a CSV file  with some data (Name and Data) and save it 
Now go to Jmeter CSs data set config browse and upload the css file create

Make few more changes in place of 
variable name - Name and Dept
Ignore first line - True
Delimeter - \t (as suggested)




Now move on the Sampler-" Java Request" and rename it with header elements of CSV
As we have Name and dept 2 fields in CSV so the format for referring the variables will be  "Request ${Name} ${Dept}"(You can leave space between the Request Name and dept)


To get the result add Listener "View results in Tree"
In Thread Group as we have 4 users present lets enter 4 ramp up 4 and as we have to run all users only once so loop count - 1'
Uncheck - Specify Thread Lifetime

Now click on run and see the results in Tree format


HTTP Header manager 

The Header Manager lets you add or override HTTP request headers. The header entries are merged to form the list for the sampler. If an entry to be merged matches an existing header name, it replaces the previous entry. This allows one to set up a default set of headers, and apply adjustments to particular samplers. Note that an empty value for a header does not remove an existing header, it justs replace its value.

In order to execute ass HTTPS test script recorder

Thread group-> Recording controller

add HTTP Header manager and listener "Tree Results"




Now run the test script recorder once running open the weblink https://www.orangehrm.com in Firefox(where proxy server settings are done for ratios check blog) and check the recording controller


Once the steps are recorder here  run the whole test and see the Results in Tree view





HTTP cookie manager

The Cookie Manager element has two functions:
First, it stores and sends cookies just like a web browser. If you have an HTTP Request and the response contains a cookie, the Cookie Manager automatically stores that cookie and will use it for all future requests to that particular web site. Each JMeter thread has its own "cookie storage area". Second, you can manually add a cookie to the Cookie Manager. However, if you do this, the cookie will be shared by all JMeter threads.

HTTP Request default

This element lets you set default values that your HTTP Request controllers use. For example, if you are creating a Test Plan with 25 HTTP Request controllers and all of the requests are being sent to the same server, you could add a single HTTP Request Defaults element with the "Server Name or IP" field filled in. Then, when you add the 25 HTTP Request controllers, leave the "Server Name or IP" field empty. The controllers will inherit this field value from the HTTP Request Defaults element.



DNS Cache Manager

The DNS Cache Manager element allows to test applications, which have several servers behind load balancers (CDN, etc.), when user receives content from different IP's. By default JMeter uses JVM DNS cache. That's why only one server from the cluster receives load. DNS Cache Manager resolves names for each thread separately each iteration and saves results of resolving to its internal DNS Cache, which is independent from both JVM and OS DNS caches.






Comments

Popular posts from this blog

Cucumber - Execution of test cases and reporting

Before going through this blog please checkout blog on   Cucumber Fundamentals Cucumber is testing tool which implements BDD(behaviour driven development).It offers a way to write tests that  anybody can understand, regardless of there technical knowledge. It users Gherkin (business readable language) which helps to  describe behaviour without going into details of implementation It's helpful for  business stakeholders who can't easily read code ( Why cucumber tool,  is  called  cucumber , I have no idea if you ask me I could have named it "Potato"(goes well with everything and easy to understand 😂) Well, According to its founder..... My wife suggested I call it  Cucumber  (for no particular reason), so that's how it got its  name . I also decided to give the Given-When-Then syntax a  name , to separate it from the  tool . That's why it's  called  Gherkin ( small variety of a cucumber that's been pickled. I...

Automating Flipkart via selenium

                                            Hi Folks, we are automating a flipkart site where you will see how to search and filter the product you choose without logging in . import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; import org.testng.annotations.Test; public class flipkart { WebDriver driver ; @Test       public void test()       {   System.setProperty( "Webdriver.chrome.driver" , "chromedriver" );     WebDriver driver = new ChromeDriver();   driver .manage().timeouts().implicitlyWait(5, TimeUnit. SECONDS );   driver .manage().window().maximize();          driver .get( "https://www.flipkart.com" );   ...