Tuesday, 16 April 2019

Jmeter Installation for Windows

This tutorial series if to learn jmeter from basics to advance level. In this post we will see how we can install jmeter and about basics overview of jmeter elements to write your first jmeter script.

1. Firstly, before installing jmeter we need to have java 8 installed in our system to do so click on link below and download and install java 8.





2. Verify Java is installed - Go to Command prompt and run java  -version .

How to install Jmeter in easy steps 


4. Installation of JMeter is extremely easy and simple. You simply unzip the zip/tar file into the directory where you want JMeter to be installed. There is no tedious installation screen to deal with! Simply unzip and you are done!
Once the unzipping is done installation directory structure should look like below -
  • /bin: Contains JMeter script file for starting JMeter
  • /docs: JMeter documentation files
  • /extras: ant related extra files
  • /lib/: Contains the required Java library for JMeter
  • /lib/ext: contains the core jar files for JMeter and the protocols
  • /lib/junit: Junit library used for JMeter

5. Run jmeter.bat file in bin folder.

 How to install Jmeter in easy steps

That is it! we have installed jmeter . You can right click on jmeter.bat and create a desktop shortcut for yourself.

If you face any issues do post it in comment section below.




Friday, 1 February 2019

Performance Testing Basics

What is Performance Testing?


Performance testing is a non-functional testing technique performed to determine the system parameters in terms of responsiveness and stability under various workload. Performance testing measures the quality attributes of the system, such as scalability, reliability and resource usage.

The focus of Performance Testing is to check -
  •     Speed - Application's response time.
  •     Scalability - Maximum user load the software application can handle.
  •     Stability - Determines if the application is stable under varying loads.

Why Do Performance Testing?


Performance Testing is done to provide with test report about the application regarding speed, stability, and scalability.Lack of Performance Testing, software is likely to suffer from issues such as: running slow while several users use it simultaneously, inconsistencies across different operating systems and poor usability.Applications released to market with poor performance metrics due to nonexistent or poor performance testing are likely to gain a bad reputation and fail to meet expected sales goals.

According to Dunn & Bradstreet, 59% of Fortune 500 companies experience an estimated 1.6 hours of downtime every week. Considering the average Fortune 500 company with a minimum of 10,000 employees is paying $56 per hour, the labor part of downtime costs for such an organization would be $896,000 weekly, translating into more than $46 million per year.

Only a 5-minute downtime of Google.com (19-Aug-13) is estimated to cost the search giant as much as $545,000.

It's estimated that companies lost sales worth $1100 per second due to a recent Amazon Web Service Outage.

Hence, performance testing is highly important before software release. 

Types of Performance Testing

  • Load testing - checks the application's ability to perform under anticipated user loads. The objective is to identify performance bottlenecks before the software application goes live.
  • Scalability testing - The objective of scalability testing is to determine the software application's effectiveness in "scaling up" to support an increase in user load. It helps plan capacity addition to your software system.
  • Stress testing - involves testing an application under extreme workloads to see how it handles high traffic or data processing. The objective is to identify the breaking point of an application.
  •  Endurance testing - is done to make sure the software can handle the expected load over a long period of time.
  • Volume testing - Under Volume Testing large no. of. Data is populated in a database and the overall software system's behavior is monitored. The objective is to check software application's performance under varying database volumes.
  • Spike testing - tests the software's reaction to sudden large spikes in the load generated by users.

Thursday, 30 August 2018

Multi Browser or Cross Browser Testing with TestNG

It is very important to test your web application across multiple browser. Each browser as different way of processing the code and hence user experience might differ from browser to browser as a tester it is our responsibility to make sure our application works fine on most commonly used browsers such as firefox, chrome and IE. 
TestNG allows us to automate the multi-browser testing using TestNG parameters. In this post we will see in detail how we can achieve this withe simple example.

Example.

1. Create a simple test script.

2. Configure it to pass Browser Type as a parameter.

package test;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;
 
import org.openqa.selenium.firefox.FirefoxDriver;
 
import org.openqa.selenium.ie.InternetExplorerDriver;
 
import org.testng.annotations.AfterClass;
 
import org.testng.annotations.BeforeClass;
 
import org.testng.annotations.Parameters;
 
import org.testng.annotations.Test;
 
public class MultiBrowserTest {
 
 public WebDriver driver;
 
  @Parameters("browser")
 
  @BeforeClass
 
  // Passing Browser parameter from TestNG xml
 
  public void beforeTest(String browser) {
 
  // If the browser is Chrome, then do this
 
  if(browser.equalsIgnoreCase("chrome")) {
 
   System.setProperty("webdriver.ie.driver", "C:\\Softwares\\chromedriver_win32\\chromedriver.exe");
   
   driver = new InternetExplorerDriver();;
 
  // If browser is IE, then do this   
 
  }else if (browser.equalsIgnoreCase("ie")) { 
 
   // Here I am setting up the path for my IEDriver
 
   System.setProperty("webdriver.ie.driver", "D:\\QA\\drivers\\IEDriverServer.exe");
 
   driver = new InternetExplorerDriver();
 
  } 
 
  // Doesn't the browser type, lauch the Website
 
  driver.get("http://www.qaautomated.com"); 
 
  }
 
  // Once Before method is completed, Test method will start
 
  @Test 
  public void search() throws Exception {
    
   Thread.sleep(5000);
      driver.findElement(By.xpath("*//input[@class='search-field']")).sendKeys("appium");
      
      driver.findElement(By.xpath("*//input[@class='search-submit']")).click();
 
      driver.quit();
 
 
 }  
 
  @AfterClass public void afterTest() {
 
  driver.quit();
 
 }
 
}

3. Mention browser type details in testng.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
  <test name="ChromeTest">
 
 <parameter name="browser" value="chrome" />
 
 <classes>
 
 <class name="test.MultiBrowserTest" />
 
 </classes>
 
 </test>
 
 <test name="IETest">
 
 <parameter name="browser" value="ie" />
 
 <classes>
 
 <class name="test.MultiBrowserTest" />
 
 </classes>
 
 </test> <!-- Test -->
</suite> <!-- Suite -->

4. Run it as TestNG Suit.

Parallel Execution - Consider you want to execute your tests in parallel on multiple browser then with a small change to your testng.xml you achieve this


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests">
  <test name="ChromeTest">
 
 <parameter name="browser" value="chrome" />
 
 <classes>
 
 <class name="test.MultiBrowserTest" />
 
 </classes>
 
 </test>
 
 <test name="IETest">
 
 <parameter name="browser" value="ie" />
 
 <classes>
 
 <class name="test.MultiBrowserTest" />
 
 </classes>
 
 </test> <!-- Test -->
</suite> <!-- Suite -->

.