MainMenu

Home Java Overview Maven Tutorials

Monday 30 October 2017

First Script in Jmeter



Create First Script in Jmeter



Test plan : Test plan is just like a container which will contain all our test element that need to performe test.

Work bench : Work bench is a place where we can keep our element for temporary basis.

Thread Group : Contains the no. of user & their configuration with time.
Basically thread group is the users that will be used to create & run the test.
Each user will be treated as thread

Elements of Thread Group
Number of Threads(Users) : Simulates the no. of users on application under test.No of user application want to test.
Ramp-Up Period(in Seconds):In how many time all the user will hit the application
For Example : If value of "Number of Threads" is "10" and "Ramp-Up Period" is "20" seconds.
That its means each thread(User) will start 2 seconds later after the previous thread was started.
Formula : Ramp-Up Period/Number of Threads, in our case : 20/10 = 2 seconds.

Loop Count: Tell the Jmeter that how many times test will be executed,
For Example : If we have "loop" value is "5" then each user will hit the application 5 times.
means total : 10*5 = 50
Total 50 request will be send to the application with a 2 second gap.

Jmeter Overview , Download and Install Jmeter

Overview of Jmeter



Hello Friends,

In This article we are going to discuss about basic functionality of Jmeter.

For Video :- Click Here

Let's Have a little discussion on aspects releated to Jmeter

Performance testing : It is the type of testing which will ensure that how an application will behave with different kind of users, no of users , with different network & other environment.
It have Four main Aspects :
Scalibility
Stress
Load
Endurance

Scalibility Testing :The main Agenda is to check effectiveness of application under certain load.
Stress Testing:- To check the upper limit of extreme workloads to see how it handles high traffic and find the break point of application.
Load Testing :-How much Load(No. of User) applicatio can handle & whethere application performe well under specified Load or not.
Endurance testing :- Application can handle a cenrtain load for a long period of time.


The Apache JMeter is a Open Source Java based software and it was developved by Stefano Mazzocchi of Apache Software Foundation, mainly designed to test the load test behaviour and measure the performance.
Jmeter is designed to cover tests like Load, Functional, Performance, Regression etc.

Pre-Requisites :- One should have basic under standing of Java Programming language, text Editor and execution. And machine should have JDK installed.
To download & install JDK Click Here

JMeter Features :
It is free bacause it is Open source.

A good and User friendly GUI.

Can Perform load test on many different server types like HTTP, HTTPS, SOAP, JDBC etc.

Its Platform independent tool because it is a pure java application.

Automation functional, regression, performance etc testing can be done easily.




Download & Install Jmeter in Your Machine



How to Donwload Jmeter ?
Click here

How to Download Badboys?
Click here
How to Start Jmeter in Windows ?
Navigate to Windows -->Jmeter Folder --> bin --> Click on jmeter.bat file
Screen Shot :-



Commond to open Jmeter in Mac
Mac --> Open terminal --> Jmeter --> bin --> sh jmeter.sh

Wednesday 25 October 2017

HeadLess Browser testing in Selenium


Hello friends,

In this article we will discuss about headless or Ghost browser :

For Video :- Click Here



What is headless browser ?

Browser which is not visible to user is known as headless browser.
They are also know as Ghost browser.
in terms of selenium, Browser which will be controlled by selenium but will not be visible to user is known as headless browser testing.


Different kind of headless browser

In selenium we have following headless browser :

1).HtmlUnit
2).PhantomJS
3).Ghost
4).ZombieJS
5).Watir-webdriver
6).Jbrowser


Lets Talk about HtmlUnitDriver
1). The fastest browser among all the browsers
2). Excellent JavaScript support
3).Support for the HTTPS and HTTP protocols
4).Support for HTML responses
5).Support for cookies
5). Proxy server support
7). Support for basic and NTLM authentication
8).Support for submit methods GET and POST
9). Ability to customize the request headers being sent to the server
10). Ability to determine whether failing responses from the server should throw exceptions or should be returned as pages of the appropriate type


Cons of HtmlUnitDriver
1).It cannot emulate other browsers JavaScript behavior
2).Many times it get for complicated scripts

How to configure HtmlUnitDriver in Selenium Project

First of all download the jar files of HTMLUnitDriver by using below links :=

Download from website : Click here
download from google driver : Click here

Now create the Java Project & add this Jar file in your project 

 


Code

import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.File;
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.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
public class GhostDR
{
WebDriver driver;
@BeforeTest
public void g()
{
driver = new HtmlUnitDriver();
//System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\Complete selenium\\chromedriver.exe");
//driver = new ChromeDriver();
driver.navigate().to("http://www.way2testing.com");
}
@Test
public void h()
{
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
System.out.println(driver.getTitle());
}
}




output :

Best Online Software Testing Tutorial: Software Testing
PASSED: h


Another good headless browser is phantomJS
PhantomJS is a headless browser with Javascript API.
It is also a favorite browser for most of Automation tester.
The main thing is that it is fast & able to handle large & complicated Script.
Download Phantom JS Browser below :
Download from Maven Website : Click Here to Download PhantomJS Driver
Click here to Download phantomJS Jar

Click here to download from Google Drive
Configure the project for PhantomJSDriver :-
You need to follow few steps :-
1). File file = new File("local system path/bin/phantomjs.exe")

2).set the path of PhantomJSDriver
System.setProperty("phantomjs.binary.path", file.getAbsolutePath())

3).WebDriver driver = new PhantomJSDriver();



Code

import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.File;
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.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
public class PISOFT
{
WebDriver driver;
@BeforeTest
public void g()
{
File file = new File("D:\\Selenium\\Complete selenium\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe");
System.setProperty("phantomjs.binary.path", file.getAbsolutePath());
driver = new PhantomJSDriver();
//driver = new HtmlUnitDriver();
//System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\Complete selenium\\chromedriver.exe");
//driver = new ChromeDriver();
driver.navigate().to("http://www.way2testing.com");
}
@Test
public void h()
{
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
System.out.println(driver.getTitle());
}
}


output :

Best Online Software Testing Tutorial: Software Testing
PASSED: h







Tags :-


Headless browser testing in selenium


Selenium testing with PhantonJS browser


Selenium testing with Ghost browser


Selenium testing with HTMLUnitDriver


How to Download and Configure PhantomJSDriver


How to Download and configure HTMLUnitDriver




Wednesday 4 October 2017

Review and Bug Life Cycle

What is review?


Reviews are part of static testing, where tester are required to check/verify the documents like test case, RTM, test plan etc.


Kinds to review :


Walk Through : Not a formal process, led by author generally done for higher level document requirement Specification etc.

Inspection : Most formal review done by trained moderator

Informal Review : documents are prepared and checked thoroughly by the reviewers before the meeting & It involves peers to examine the product Formal/Technical Review : Done by the development team to technically verify the documents.



Roles & responsibility in a Review :

The Moderator : Review lead by moderator & his role is to determine the type of review, approach and the composition of review team. The Author : As the writer of the ‘document under review’, the author’s basic goal should be to learn as much as possible with regard to improving the quality of the document.
The Scribe/Recorder : he is responsible to record the bulletined points in review along with defect, feedback & suggestions. The reviewer : The role of the reviewers is to check defects and further improvements in accordance to the business specifications, standards and domain knowledge.

What are different phases of formal review?


Formal review process have below phases :


Planning
Kick-off
Preparation
Review meeting
Rework
Follow-up.

Note : In Some organization informal review is termed as Peer Review, where review is done inside the team by team member & generally it is done without any documentation.
Organization which follow review process also have checklist for review sheet with below point :

> Major functionalities are covered in test cases with high priority.

> GUI featured are covered properly.

> Test case document follow the organization approved document format & structure.

> Test steps are suitable to achieve the objective/Scenario.




Bug life cycle/Defect life cycle :

This cycle explain the life of a bug/defect which was found during testing.
As Diagram says it have different phases :

Defect Found : Potential defect that is raised and yet to be validated.
Verification : Now this bug will be inspected by lead & try to replicate it & it have two outcomes :
a: Rejected : If this is not a bug &; it is FAD (Functioning as designed) also it will be closed.
b: Open : Bug can be replicated successfully.
Assigned : If Bug is valid then it will be assigned to associative developer & status of bug will be assigned.
Fixed : Associated devfeloper will work on it & fix it and after that status will be fixed.
QA Verification/To Be verified : Here QA team/associated tester will RETEST the bug & again two out come will come
a : Verified/Closed : If bug is fixed then tester will pass it & status will become passed & bug will be closed.
b : RE-OPEN : If bug is still exist & test is able to replicate it then bug will be failed by tester & its status will become Assign.
END : Bug life cycle will end here and document will be updated with build number i.e Build x1.0 has four bugs & they are fixed.

There are some more status of bug :
Deffered : if bug is valid and it will be fixed in next further Iteration/Release then it will be marked with status deffered.
Deployed to QA : Bug has been fixed & deployed to QA environment & waiting for tester to Re-test it.
Ready to Release : Now bug is passed by tester & build is ready to release with fixed bug.



What is severity & priority ?

Bugs can be majored with two parameter :-
Severity : It defines the impact that a given defect has on system in other word "How much bug is serious with respect to the functionality."
Severity Types : Critical , Major, Moderate, Minor, Cosmetic
Priority : Priority defines the order in which bug/defect should be resolved. should we fix it now or can it wait?
Priority Types : Low, Medium & High.
Priority in Jira : High, Low & Medium
Severity in jira :
6-Blocker
5-Urgent
4-Very High
3- High
2- Medium
1- Low

Examples of high severity & high priority :


Master data can not be created when user click on "Create" button application get crashed.

OR
An error on basic functionality, which prevent user to use the application.

Example of high severity & low priority :


A job can be done by n number of ways but out of n , one is not working also this is not much more used by users.


(Email CRM : , User can send the email by method A, B, C....except C all are working & method C is very rarely used by user)



Example of low severity & High priority :


There is no validation message for wrong input although at last application will not submit the data.



Example of low severity & low priority :


Any cosmetic or spelling or grammatical error




What is Software Testing ???


What is manual testing ?


What is Smoke testing ?


What is Test Cases ?

How to write the test cases?


When to start test case execution ?


Test Management tools


How much negative test cases should write?


What is Retesting?


Exploratory Testing?


Regression Testing?


What is Ad-hoc Testing?


What is Unit testing?


What is Sanity Testing?

Difference between smoke and sanity testing


Types of Software Testing


What is review?


Kinds to review :


What is Formal review?


What is technical review :


Phases of review ?


What is peer review?


Bug life cycle in software testing?


what is severity & priority?


Example of high severity and high priority ?


Example of high severity and low priority?


Example of low severity and high priority


Example of low severity and low priority

Defect Clustering in Software Testing

What is Defect Clustering in Software Testing?

Defect Clustering :- As the Name says, a cluster of defect, which indicate that An area which have defect have more probability of existance of defect.

This below graph will elaborate more about defect custering.



Defect Clustering in Software Testing is one of the seven principles of Software Testing.

During software testing, as defects are found, analysis of defects can give surprising results!

Defect Clustering in Software Testing means that the majority of the defects are caused by a small number of modules, i.e. the distribution of defects are not across the application but rather centralized in limited sections of the application.

When a small number of modules contains most of the bugs detected or show the most operational failures.

This is particularly true for large systems where the complexity, size, change and developer mistakes can impact the quality of the system and affect particular modules.

Defect Clustering in Software Testing is based on the Pareto principle, also known as the 80-20 rule, where it is stated that approximately 80% of the problems are caused by 20% of the modules.

In this image the principle of defect clustering in software testing can be seen that most of the defects are clustered in particular sections of the application of an application e.g. Product Details, Reviews and Search Results Page for an e-commerce website and the remaining defects in other areas.

This can give a good indication that when a defect is found in one area of the application, chances are there are more defects in that particular area, so it is worth investing more time to test that particular area of the application to find as many defects as possible. However, testers should not ignore to test the rest of application as well as there may be other defects scattered around.

Defect aggregation or defect clustering in software testing can also indicate which area of the application needs more regression testing to ensure related features are not broken.

Analysis of test execution reports and grouping of the defects by features of the application produces a histogram which proves the principle of defect clustering in software testing. This helps with understanding of the defects better and also help with test case prioritization when there is not enough time to execute all the tests.

Advantages:
Tester can focus the same area in order to find the more number of defects.
Helps in reducing the time and cost of finding defects.