Road to correlation in Jmeter test script

Today, I continue posting regarding jmeter, in my previous two post I explained how to create jmeter test script and how parameterize test scripts from external file? In this post I am going to explain about correlation in jmeter

What is Correlation: correlation play most important role in jmeter scripting. It is a procedure by which fetching dynamic data from a request’s response and passing it into next request.

Why need Correlation: 
Suppose we have a login scenario in which.
     1. User enter credential and click on submit button.
     2. At dashboard click any tab.
Now, if I recoded above scenario and replay back using jmeter then test will fail. The reason behind it that authentication mechanisms use here. As when I recorded test script server automatically generated a dynamic session id which passed in next request of test for validating authentication of user. So when I executed test scripts every time a new session Id generated dynamically as user login request sent, we need to pass same session Id in next request. So these types of scenarios we need to handle using correlation of jmeter

Road to parameterization in Jmeter test script

Parameterization is process by which user input some values to test script at execution time using external files such as csv, xls, txt, xml etc. In Jmeter test, suppose we need to check login functionality with 100 set of user so in this case we parameterize users from external file. At execution time user picked dynamically .

Steps Jmeter parameterization.

1. After capturing request and responses of your web application you need to create a csv file and put data in file separated with comma. As I created below  csv file for urls parameterization


Road to Jmeter - procedure to create first test script for the beginners

Set up and installation:

1. Download java(JDK) from link "“http://www.oracle.com/technetwork/java/archive-139210.html” and setup path in your system environment variable.
2. Download apache Jmeter from link “http://jmeter.apache.org/download_jmeter.cgi”.
3. Unzip downloaded Jmeter package in your machine, go to extracted folder and open bin folder.
4. Click on “jmeter.bat” file you should see that a cmd screen and Jmeter console should opened as below.


After completing above steps you are ready to create First Jmeter script.    

Road to create test script using Pywinauto

Pywinauto is python based GUI automation tool, using this we can automate windows application.

Set up:

To set up pywinauto you need to install some prerequisite in you machine as mentioned below.
 1. Python
 2. SendKeys (SendKeys-0.3.win32-py2.6.exe)
 3. setuptools-0.6c11.win32-py2.6.exe.

Download pywinauto from link http://sourceforge.net/projects/pywinauto/files/ and unzip in your machine.
Open command prompt and go to unzip folder “pywinauto” and run command

 python setup.py install

To check you have it installed correctly

Road to create executable jar using maven

In this post I explained the procedure to create executable jar file using maven build tool.

You need to create java maven project using eclipse.

Here is example of a java class having main method.

Road to create executable jar using ant build tool

In this post I explained the procedure to create executable jar file using ant.

You need to create java project using eclipse , create a lib folder in your eclipse project.

Here is example of a java class having main method.

Road to verify images using java webdriver

In this post I have explained that how to verify images in webdriver using java. As webdriver does not provide direct any function to image verification, but we can verify images by taking two screen shots of whole web page using “TakesScreenshot” webdriver function, one at script creation time and another at execution time,

In below example I have created a sample script in which first I captured a Google home page screen shot and saved (GoogleInput.jpg) into my project, Another screen shot “GoogleOutput.jpg” captured of same page at test executing time and saved into project. I compared both images if they are not same then test will script fail.

Road to verify 200 response code of web application in java webdriver

This post will help to verify HTTP response code 200 of web application using java webdriver. As webdriver does not support direct any function to verify page response code. But using "WebClient" of HtmlUnit API we can achieve this.

Html unit API is GUI less browser for java developer, using WebClent class we can send request  to application server and verify response header status.

Below code, I used in my webdriver script to verify response 200 of web application

 String url = "http://www.google.com/";
 WebClient webClient = new WebClient();
 HtmlPage htmlPage = webClient.getPage(url);

 //verify response
 Assert.assertEquals(200,htmlPage.getWebResponse().getStatusCode());
 Assert.assertEquals("OK",htmlPage.getWebResponse().getStatusMessage());

Road to accept certificates in internet explorer using webdriver

One of my projects, I need to verify application certificates during test case execution . It was working fine on firefox and google chrome browser as webdriver automatically accept certificate.  But Internet Explorer webdriver was not accepted automatically after doing a lot of observation, finally I got solution by navigating below java script code with webdriver object.

 driver.navigate().to("javascript:document.getElementById('overridelink').click()");

Road to verify PDF file text using java webdriver

In this post I will explain the procedure to verify PDF file content using java webdriver. As  some time we need to verify content of web application pdf file, opened in browser.
Use below code in your test scripts to get pdf file content.

Jenkins Hudson

Jenkins is an open source continuous Integration tool written in java originated by Hudson.  Jenkins is most popular continuous integration tool in market. The reason is Jenkins is easy to use, open source, intuitive user interface and powerful features, supported variety of languages, technologies including Java .net, PHP, Ruby, Python, and Groovy etc.

Junit Test with Maven

In this post I will explain how to create and run JUnit test using maven. download Apache maven from link “download”, extract zip package into you machine and setup path maven bin folder into your system  environment variable. following are the steps to create JUnit test for maven and maven commands.

JUnit Test creation:

Create source folder in your eclipse “src/test/java” and “src/main/java” as below screen:

Procedure to run AutoIt script using ant (build.xml) tool.

In this post I will cover the procedure of AutoIT script execution with the help of ant build tool. As we know ant has java based library. But here I have set AutoIT compiler with Ant's build.xml file and can execute AutoIT scripts
  1. Ant path must be set in to system environment variable.
  2. AutoIT installation directory path must be set in to system environment variable.
    Below is a sample build.xml file for AutoIT script execution.

PHP Selenium RC data driven testing

In this post I will cover the procedure of data driven testing in selenium RC with phpunit framework.  PHP unit provide @dataProvider provider annotation.

In this post I have created a data driven test script in phpunit on Wikipedia where I put some country data in to excel file.