FindElement and FindElements in Selenium WebDriver.

The Hacks of The Day
Find Element and FindElements in Selenium WebDriver.

WebElement Interface Hierarchy: 

Before going into depth, how to find the element in selenium. First, we will have a look at the basic architecture of the WebElement interface. It extends SearchContext and TakesScreenShot interfaces. It has many useful abstract methods like click, sendKeys, isSelected(), etc. Given below is a basic architecture of WebElement interface.



Find Element, or Elements command is used to interact with the web elements. If you want to find a single element, then you will have to use Find Element command, but for more than one element Find Elements command is used.

There are multiple ways to uniquely identify a web element within the web page such as ID, Name, Class Name, CSSSelector, Link Text, Partial Link Text, Tag Name, and XPath, etc.

FindElement Command Syntax: 

Find Element command takes an object "By" as a parameter and returns an object of type WebElement.By object can be used with various locators like ID, Name, Link Text, Class Name, Tag Name, Xpath, and CSSSelector. Find Element method returns a single WebElement. Suppose we wanted to find an element by the "id" attribute, the command will be written as given below
WebElement element = driver.findElement(By.id("id_value"));
Following locators can be used in Selenium WebDriver:
  • ID Name 
  • Class Name 
  • CSSSelector 
  • Tag Name 
  • Link Text 
  • Partial Link Text 
  • XPath 
Locator Value should be a unique value using which a web element can be identified. It is the responsibility of developers to make sure that web elements are uniquely identifiable using certain properties such as ID, Name, or Class.
Example:
WebElement loginName = driver.findElement(By.xpath("//input[@type= 'email']"));

FindElements Command Syntax: 

Find Elements command also takes an object "By" as a parameter and returns a list of web elements. It returns an empty list if there are not elements found using the given locator type and value. Below is the command syntax of find elements
List elementName = driver.findElements(By.LocatorType("LocatorValue"));
Example:
List listOfElements = driver.findElements(By.xpath("//button[@type='button']"));

Working Example of FindElement: 

  1. Go here https://accounts.google.com/
  2. Find the text field to enter email
  3. Enter email

package learning;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class FindElement {

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  
  System.setProperty("webdriver.chrome.driver", "/home/khawer/Desktop/chromedriver");
  WebDriver driver = new ChromeDriver();
  driver.manage().window().maximize();
  driver.manage().deleteAllCookies();
  driver.get("https://gmail.com");
  WebElement username = driver.findElement(By.xpath("//input[@type= 'email']"));
  username.sendKeys("test@gmail.com");
  //driver.close();
 }
}
The above code will do the following things:

  • Will open the specified URL
  • Will locate the email field
  • Will enter the email into the text field

Working Example of FindElements: 

  1. Open the URL under test
  2. Find all the buttons
  3. Print the tag name

package learning;

import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class FindElements {

 public static void main(String[] args) {
  // TODO Auto-generated method stub

  System.setProperty("webdriver.chrome.driver", "/home/khawer/Desktop/chromedriver");
  WebDriver driver = new ChromeDriver();
  driver.manage().window().maximize();
  driver.manage().deleteAllCookies();
  driver.get("https://www.google.com/intl/en-GB/gmail/about/");
  List list = driver.findElements(By.xpath("//button[@type='button']"));
  System.out.println("Number of elements:" + list.size());
  for (int j = 0; j < list.size(); i++) {
   System.out.println("Element "+i+" Tag Name:" + list.get(i).getTagName());
  }
 }
}
Output:
Element 0 Tag Name:button
Element 1 Tag Name:button
Element 2 Tag Name:button
Element 3 Tag Name:button
Element 4 Tag Name:button
Element 5 Tag Name:button
Element 6 Tag Name:button
Element 7 Tag Name:button
Element 8 Tag Name:button

Method Detail: 

  findElements

  Find a list of web elements within the web page.

 Parameters: The object reference variable of WebElement Interface

 Returns: A list of all WebElements.

 findElement

 WebElement findElement(By by)

 Find the first web element within the web page.

 Parameters: By class, the object is passed as a parameter

 Returns: The object reference variable of WebElement Interface

 Throws: NoSuchElementException - If no matching element is not found

Conclusion: 

  • Find Element command returns a single web element 
  • Find Elements command returns a list of web   element 
  • Find Element command throws NoSUchElementFoundException if it does not find the   matching element 
  • Find the Elements command returns an empty list if there are no matching elements.

First Selenium WebDriver Script in Java

The Hacks of The Day
As in our previous lecture, we have discussed the basic configuration of the selenium web driver. In this article, we will discuss how to write the first script in Java using selenium web driver. let us try to create a WebDriver script of the following test scenario:

Test Scenario: 

Open this URL https://www.gmail.com/
Give Username
Click on Next button
Give Password
Click on the Next button
Below is the selenium web driver code for the above scenario.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class GmailLoginScript {

 public static void main(String[] args) {

  // First we need to set path for chromeDriver
  //System.setProperty("webdriver.gecko.driver","/home/khawer/Desktop/geckodriver");
  System.setProperty("webdriver.chrome.driver","/home/khawer/Desktop/chromedriver");
  WebDriver driver = new ChromeDriver();
  driver.manage().window().maximize();
  driver.manage().deleteAllCookies();
  driver.get("https://gmail.com");

  // UserName is given wrong deliberately. You can use your valid UserName.
  WebElement username = driver.findElement(By.xpath("//input[@type= 'email']"));
  username.sendKeys("test@gmail.com");

  WebElement nextBtn = driver.findElement(By.xpath("//span[text()= 'Next']"));
  nextBtn.click();

  // Password is given wrong deliberately. You can use your valid Password.
  try {
   Thread.sleep(1000);
  } catch (InterruptedException e) {
   e.printStackTrace();
  }
  WebElement password = driver.findElement(By.xpath("//input[@type = 'password']"));
  password.sendKeys("abc123");
  driver.findElement(By.xpath("//div[@id = 'passwordNext']")).click();
  // close Firefox
  driver.close();
 }
}
Now let's try to explore the above script written for Gmail login.

Property Settings: 

Before going into detail of this line of code first, we need to understand one thing that is browser driver. Every browser has a browser driver like FirefoxDriver, ChromeDriver, etc. You can download the respective browser driver that you are going to use in your application. For the Firefox browser, we need to download a gecko driver.
In this example we have used the chrome browser, so we have downloaded a chrome driver. In the SetProrpty method, we need to give two parameters one is "value" and the other is "key".
The following are the two parameters for this method. value: webdriver.chrome.driver Key: chrome driver path on your local system, where you have placed the executable.
System.setProperty("webdriver.chrome.driver","/home/khawer/Desktop/chromedriver");

Note: Compatibility is a major issue while using Firefox. For Firefox 35, you should use a gecko driver created by Mozilla to use Web Driver. The use of Selenium 3.0, gecko, and firefox has compatibility issues, and setting them correctly could become an uphill task. In case of any issue, downgrade to Firefox version 47 or below. But for on Chrome things are much easy. Selenium works out of the box for Chrome. Without a Chrome Driver, we can't instantiate the Chrome browser.

If we run the program without setting the system property, the system will through the following exception. "IllegalStateException"

Object and variables Initialization: 

Normally, this is how a driver object is created. Actually, "driver" is a reference variable of the WebDriver interface and an object of ChromeDriver class is assigned to it. It means ChromeDriver class will implement all methods of WebDriver interface.
WebDriver driver = new ChromeDriver();

Clear Cookies & Maximize Window: 

The following two-line is used to clear the cookies before launching the browser. This line of code is not mandatory, but for better performance, we can use it.
driver.manage().deleteAllCookies();
This command is used to maximize the browser window.
driver.manage().window().maximize();

Starting Browser Session: 

In Selenium Web Driver get() method is used to launch a new browser session and directs it to the URL that you specify as its parameter. The following statement will launch a browser and open the Gmail login page.
driver.get("https://gmail.com");

Finding UI Elements: 

To find the UI elements different locators are used in Selenium WebDriver. You can find UI elements by XPath, ID, Name, Class, CSSSelectors, LinkText, etc. We will discuss it in full detail in the upcoming lecture. Here we are using findelement() method of WebDriver interface to find the particular element.
A reference variable of the Web Element interface is used to store the particular element. Basically, the WebElement interface is responsible to interact with web elements like sendkeys(), click(), etc.

WebElement username = driver.findElement(By.xpath("//input[@type= 'email']"));
username.sendKeys("test@gmail.com");
WebElement nextBtn = driver.findElement(By.xpath("//span[text()= 'Next']"));

You can also write it in a simple way. For understanding the purpose above statements is good.
driver.findElement(By.xpath("//input[@type='email']")).sendKeys("test@gmail.com");

Clicking on an Element: 

The Click() method is used to click on any web element.
nextBtn.click();
The following lines of code are just a way of making selenium WebDriver to wait, until the next element loads. There are two types of wait in Selenium WebDriver that we will discuss in detail in a separate article.
A brief introduction to wait is:
Implicit wait - A default waiting time that is used throughout the program
Explicit wait - It is used to wait for a particular instance only.

In this article, we are just giving a basic introduction to Selenium WebDriver. In some situations, without using the wait script not works properly. An exception raised, "NoSuchelementFound". So it is necessary to use the wait in Selenium WebDriver where elements are not loaded accurately.
try {
   Thread.sleep(1000);
  } catch (InterruptedException e) {
   e.printStackTrace();
  }
Similarly, we can find the password field by using the findelement() method.
WebElement password = driver.findElement(By.xpath("//input[@type = 'password']"));
  password.sendKeys("abc123");
To click on the sign-in button the following line of code will work.
driver.findElement(By.xpath("//div[@id = 'passwordNext']")).click();

Close Browser Session: 

The close() method is used to close the browser that WebDriver is currently controlling.
driver.close();
It closes all the windows that WebDriver has opened.
driver.quit();
Terminating the Entire Program: This command will close your Java program without closing the window.
System.exit(0);

Conclusion: 

By reading this simple article, you can write your first script in selenium WebDriver. All the lines of code explained in a better way for the ease of readers. So stay tuned for upcoming articles. Cheers!!

How to write a test report?

The Hacks of The Day











Hey Guys! If you are a newbie in the field of software testing and don't know how to write a test report, then you are in the right place. In this article, a brief and simple explanation will give you a full hold on the test report. Writing an effective test report is a vital part of software testing.

When you send a bug to the Project Manager for checking, then the project manager will verify the bug easily if your test report has written simply and descriptively. On the other way, the Project Manager will send it back for more explanation. Now let's see what is the structure of a well-written test report and What are the fundamental elements of a test report?


Structure of the Test Report

The following are the fundamental elements of a test report. Now let's go in more detail and try to understand what about they are?

  1. Environment
  2. Browser
  3. Desktop/Device
  4. Title of Bug
  5. Testing Details
  6. Images
  7. Testing URLs
  8. Status
  9. CC (Participants)
  10. Notes (Optional Part)


Environment: Environment section describes the operating system which you are using to test a bug. If you are using Windows/Ubuntu or any other you can write it in the environment section.

Browser: In this section, you can write the name of browsers you are using for testing. Like Chrome, Firefox, IE, Opera, and Safari.

Desktop/Device: Here you can mention the name of devices that you are using to test a bug. If you are testing on Desktop then you can write "Desktop" if you are testing on Mobile Phones you can write the names of devices like iPhone 6/7/8, Huawei y7 prime, etc.

Title of Bug: Write the title of the bug that you have tested.

Testing Details: This section contains the testing details that you have tested. You should write all the points to clarify what you have tested. Normally points are written in the form of Test Cases. Write all the possible scenarios here so that the Project Manager could get understanding that you have covered all the things. It should be more descriptive.

Images: In this section, images are attached to the test report. Image's attachment is necessary because they will show that things are working fine practically. With the help of images, PM can easily see the corrected things. Without executing the application he can confirm that bug is fixed now.

Testing URLs: In this section, write the URLs that have used for testing.

Status: Status will be Fail or Pass.

CC (Participants): In this section, we tag the participants like Project Manager and Business Guys so that they could get intimated when you attach the test report.

Sample Test Report:

Environment:  Ubuntu 18

Browser: Chrome, Firefox, etc

Desktop/Devices: Desktop

Title:

Login Page - Sign in functionality is not working.

Testing Details:

Test Case1: Sign-in is working fine with valid credentials
Test Case2: Error messages are shown with invalid credentials
Test Case3: Error messages are shown with empty fields
So on...

Images:

!image1.png|thumbnail!
!image2.png|thumbnail!
!image3.png|thumbnail!
!image3.png|thumbnail!
So on...

URLs:

https://abc.com/login
https://abc.com/user/login
So on...

Status: PASS

Progress made:

=> This has been implemented. All things that are mentioned in Ticket's description are done.

=> Please check and let me know if I missed anything OR there's any kind of work that still needs to be done under this card.

CC: Rock, Steve ...

Notes: It is an optional part of a test report. Here you can write some special notes if you want to mention something related to the bug for Project Manager.

Thanks,
Tester Name

This is a basic structure of a test report. Little things can vary as per company requirements, but the basic structure will remain the same.

Java Basics - Lecture 3 - Loops in Java

The Hacks of The Day

Loops in Java














Loops are used to perform a task repeatedly. There are 3 types of loops

  1. while loop
  2. for loop
  3. do-while loop

Suppose if you want to print first 5 digits

You need to write 5 print statements

System.out.println(1);
System.out.println(2);
System.out.println(3);
System.out.println(4);
System.out.println(5);

Instead of writing repeated code, we use loops

While loop :

A control flow statement which is used to perform the repeated tasks based on a given Boolean condition. In while loop number of iterations is not fixed. Loop will be executed only if the condition is true. It is also called the entry control loop.

Flow Chart Diagram



Disadvantage: It generates an infinite loop if we don't give an incremental part

For Loop:

A control flow statement which is used to perform repeated tasks. But in for loop number of iterations are fixed.

Flow chart Diagram



Parts of for loop (Initialization, Conditional part, Incremental part)

Initialization: In this part, the variable is initialized. It is a starting point of the loop

Condition: In this part condition is checked, it returns a boolean. In the case of the true, the loop body is executed.

Increment/Decrement: Variable is incremented or decremented here for next iteration

Loop termination: When the condition becomes false, then the loop is getting terminated.

For Loop Example




public class ForLoop {
public static void main(String[] args)  {
  for(int j=1;j<=10;j++){
  System.out.println("Values of ==> " + j);
  }
 }
}

Output:
value of j ==> 1
value of j ==> 2
value of j ==> 3
value of j ==> 4
value of j ==> 5
value of j ==> 6
value of j ==> 7
value of j ==> 8
value of j ==> 9
value of j ==> 10
If you want to print 10 digits in reverse order then below code will work fine.

public class ForLoop{
 public static void main(String[] args){
  for(int k=1;k<=10;j--){
  System.out.println("Values of ==> " + k);
    }
  }
}

Post Increment

An operator that is used to increment the value of the variable after the expression is executed in which post-increment is used. The value is first used in an expression and then incremented.
public class PostIncrement{
 public static void main(String[] args){
 int i = 1;
 int j = i++; //post increment

   }
}

Pre Increment

An operator that is used to increment the value of the variable before the expression is executed in which post-increment is used. The value is first incremented in an expression and then used.  
public class PreIncrement{
 public static void main(String[] args){
 int a = 1;
 int b = ++a; //pre-increment
   } 
}

Post Decrement

An operator that is used to decrement the value of the variable before the expression is executed in which post-increment is used. The value is first decremented in an expression and then used.  
public class PostDecrement{
 public static void main(String[] args){
 int i = 2;
 int j = i--; //post decrement
   }
}

Pre Decrement

An operator that is used to decrements the value of the variable before the expression is executed in which post decrement is used. The value is first decremented in an expression and then used.  
public class PreDecrement{
 public static void main(String[] args){
 int a = 2;
 int b = --a; //pre-decrement
 System.out.println("Value of a ==> "+a);
 System.out.println("Value of b ==> "+b); 
  }
}

do-while loop :

The do-While loop is similar to while loop but the difference is that the body of the do-while loop is executed once and then the condition is verified. A control flow statement that executes a piece of code at least once.

Flow Chart Diagram


If the test expression is true, the body of the loop is executed again and the test expression is evaluated.

The first loop body is executed then the condition is checked, this process continues until the condition is false.

This process goes on until the test expression becomes false.

If the test expression is false, the loop ends.


public class DoWhileLoop{
 public static void main(String[] args){
 int counter = 5;
 int factorial = 1;
 do{
    factorial *= counter--;
 }while (counter > 0);
 System.out.println("result " +factorial);
  }
}
Output:
 result ==> 120

Array in Java

Array: Stores similar data type values in an array variable.
  1. A collection of similar data types
  2. The lowest index is always “0”
  3. The highest index is always n-1 (n is the size of the array)
Int array
Integer array stores the integer data type. 
 int arr[] = new int[4];
 arr[0] = 10;
 arr[1] = 20;
 arr[2] = 30;
 arr[3] = 40;
 System.out.println(arr[2]);
 System.out.println(arr[3]);

Output:
value of arr[2] ==> 30
value of arr[3] ==> 40

If you will try to find the arr[4], it will give exception

When you go beyond the limit, an exception will raise “ArrayIndexOutOfBoundsException”

Size of array
The size of the array is determined by using length() method.
System.out.println(arr.length)
Print all the values of the array: use for loop
 for(int i=0; i < arr.length; i++){
 System.out.println(arr[i]);
 }
Double array
Double array stores the double data type. 
double d[] = new double[3];
d[0] = 3;
d[1] = 14.33;
d[2] = 44.89;
Character array
Character array stores the character data type. 
char c[] = new char[3];
c[0] = 'a';
c[1] = '3';
c[2] = '$';
String array
String array stores the string data type. 
String s[] = new String[3];
s[0] = "test";
s[1] = "World";
s[2] = "Hello";
Disadvantages:
  1. The array size is fixed. Therefore it is called a static array
  2. Stores only similar data types
To overcome size problem we use Collections like ArrayList, HashTable
To overcome data type problem we use Object array
Object array(Object is a class) – It is used to store different data types

Object array
 Object obj[] = new Object[6];
 obj[0] = "Tom";
 obj[1] = 25;
 obj[2] = "M";
 obj[3] = 12.33;
 obj[4] = "1/10/1998";
 obj[5] = "London";
Find all elements of Object array
for(int i=0; i<obj.length; i++) {
 System.out.println(obj[i]);
}
Output
value of obj[0] ==> Tom
value of obj[1] ==> 25
value of obj[2] ==> M
value of obj[3] ==> 12.33
value of obj[4] ==> 1/10/1998
value of obj[5] ==> London

2D Array in Java
Collection of data in the form of cells
Represented as a matrix with a number of rows and columns
String x[][] = new String[3][5];
Output:
System.out.println(x.length);
Number of row ==> 3
System.out.println(x[0].length);
Number of columns ==> 5
//1st row

x[0][0] = "A";
x[0][1] = "B";
x[0][2] = "C";
x[0][3] = "D";
x[0][4] = "E";
//2nd row

x[1][0] = "A1";
x[1][1] = "B1";
x[1][2] = "C1";
x[1][3] = "D1";
x[1][4] = "E1";
//3rd row

x[2][0] = "A2";
x[2][1] = "B2";
x[2][2] = "C2";
x[2][3] = "D2";
x[2][4] = "E2";
Output
System.out.println(x[1][2]);
value of x[1][2] ==> C1</
System.out.println(x[2][2]);
value of x[1][2] ==> C2
System.out.println(x[0][4]);
value of x[1][2] ==> E
Print all the values of 2D array
Two for loops are required to get array values
//row = 0, col = 0 to 4
//row = 1, col = 0 to 4
//row = 2, col = 0 to 4

for(int i = 0; i < x.length; i++){
  for(int j = 0; j < x[0].length; j++){
  System.out.println(x[i][j]);
   }
}
Output:

  value of x[0][0] ==> A value of x[0][1] ==> B
  value of x[0][2] ==> C value of x[0][3] ==> D
  value of x[0][4] ==> E

  value of x[1][0] ==> A1 value of x[1][1] ==> B1
  value of x[1][2] ==> C1 value of x[1][3] ==> D1
  value of x[1][4] ==> E1

  value of x[2][0] ==> A2 value of x[2][1] ==> B2
  value of x[2][2] ==> C2 value of x[2][3] ==> D2
  value of x[2][4] ==> E2

Test Cases For Login Page

The Hacks of The Day


















Test Case1: Verify the login functionality with valid Username and Password

Test Case2: Verify the error message with both invalid fields

Test Case3: Verify the error message with invalid Username and valid Password

Test Case4: Verify the error message with valid Username and invalid Password

Test Case5: Verify the “Remember Me” functionality

Test Case6: Verify the “Forgot Password” functionality

Test Case7: Verify if there is a ‘Cancel’ button available to erase the entered text.

Test Case8: Verify that password is showing in the form of an asterisk

Test Case9: Verify that “Enter” key is working fine the login page

Test Case10: Verify if a user cannot enter the characters more than the specified range

in each field (Username and Password).

Test Case11: Verify the login page by pressing the ‘Back button’ of the browser.

Test Case12: Verify the timeout of the functionality of the login session.

Test Case13: Verify the login page and all its controls in different browsers

Test Case14: Verify if a user should not be allowed to log in with different credentials

from the same browser at the same time.

Test Case15: Verify if a user should be able to login with the same credentials in

different browsers at the same time.

Test Case16: Verify the Login page against the SQL injection attack.

Test Case17: Verify the implementation of the SSL certificate.

Test Case18: Verify the time taken to log in with a valid Username and Password.

Test Case19: Verify if the font, text color and color-coding of the Login page is as per

the standard.

Test Case 20: Empty spaces should not be allowed

Different Types of Software Testing

The Hacks of The Day

















Software Testing Types

There are many types of software testing such as Functional Testing, Non-Functional Testing, Automation Testing, Agile Testing, etc. Given below is a list of testing types

Functional Testing types include:

  1. Unit Testing
  2. Integration Testing
  3. Interface Testing
  4. Regression Testing
  5. System Testing
  6. Smoke Testing
  7. Sanity Testing
  8. Beta/Acceptance Testing

Non-functional Testing types include:

  1. Volume Testing
  2. Security Testing
  3. Performance Testing
  4. Compatibility Testing
  5. Install Testing
  6. Recovery Testing
  7. Reliability Testing
  8. Usability Testing

Above given testing, types are used most frequently. Now let's explain the testing types one by one which is mentioned and some other which are not mentioned. In this article, we will cover the most common testing types, not all the testing types.

Unit Testing

Testing type in which small units of an application are being tested is known as unit testing. It is normally done by developers, not by testers. The purpose of unit testing is to verify the code quality.

Smoke Testing

A testing type in which we check all the major functionalities of the application. Before starting detailed testing, testers run a smoke testing cycle to verify the build stability. Smoke testing can decide either it is good to proceed with the build or not.

Sanity Testing

Testing of small changes or bug fixes is called sanity testing. Insanity testing testers only verify the changed things, not the whole application. Suppose a tester finds a bug in the application. After that developer will fix the bug. After the bug is fixed by the developer, the updated build will be given to the tester, and the tester will only verify that bug.

Alpha Testing

A testing technique that is carried out at the developer's site is called alpha testing. Alpha testing is done before releasing the software to the end-user. This testing is carried out when the development phase is completed and software is about to launch. The main reason to run the alpha testing cycle is to identify all possible issues or defects before releasing it into the market or to the end-user.

Beta Testing

Testing which is carried out by customers is called beta testing. Beta testing is done in a real environment and end-users test the application with real data.

Ad-hoc Testing

Testing carried out by testing any flow of the application is called ad-hoc testing. This is also called random testing. Through Adhoc-testing we find the defects and try to break the application by executing any flow of the application or any random functionality. It is done without any plan or documentation.

Acceptance Testing

In acceptance, testing the client verifies whether the end to end the flow of the system is working fine or not. The client accepts the software only when all the features and functionalities work as expected. In acceptance testing client satisfaction is important.

Black Box Testing

Testing of an application's functionality without knowing the internal details is called black-box testing. Internal detail is not considered. Tests are based on the requirements and functionality.

White Box Testing

Testing of the internal structure of code is called white box testing. It is also called glass box testing. To perform white box testing coding knowledge is compulsory. Tests are run to cover the code statements, branches, conditions, etc.

Grey Box Testing

Grey box testing is a combination of both black box testing and white box testing. The aim of this testing is to find possible errors in the code and usage of the application. Both things are covered code and front-end functionality.


Back-end Testing

In back-end testing, data verification is done in the database. Either entered record is saved successfully or not. We can also verify the data retrieval.


Accessibility Testing

It determines that software or application is accessible for disabled persons or not. Disabled means color blind, deaf, mentally disabled, blind, and other groups.


Compatibility Testing

Compatibility testing validates how software behaves in a different environment. like web servers, hardware, operating systems, mobile devices, and browsers.

Functional Testing

Functional testing ignores the internal details. It focuses only on the functionality of the application either it is working as per requirements or not.

Non-Functional Testing

It is a type of testing which involves testing of non-functional requirements such as load testing, stress testing, security testing, recovery testing, volume testing, and system response, etc,


Exploratory Testing

In exploratory testing, the tester explores the application and finds the bug. A type of testing that is performed without any documentation. The application is tested by using it. Tester understands the application flow by using it and finds the defects. It's all about discovery, Investigation, and learning. Test cases are created in advance.


Monkey Testing

A technique in software testing where the user tests the application by giving random inputs and checking the behavior of the application. It aims to check the application behavior when a layman uses the software without any knowledge. No, a document is provided to perform the monkey testing.


Static Testing

Static testing is a type of testing which is performed without executing the application. It involves the review of documents, walkthroughs, and inspection of the deliverables of the project.

Dynamic Testing

Dynamic testing is a type of testing which is performed by running the application or executing the code. The user requirement's verification is done in dynamic testing.

Performance Testing

A type of nonfunctional testing is executed to check the performance of the application. How application behaves under different circumstances like load, stress, and volume.

Load Testing

Load testing is a subtype performance testing, the behavior of the application is determined during different load. The number of concurrent users is increased gradually to verify the system response under different loads.

Stress Testing

It is also a subtype of performance testing. Stress testing is used to determine the behavior of the application beyond the load. Suppose an application supports 5000 maximum number of concurrent users, so for stress testing, we will try with more than 5000 users. Similarly, we can go beyond the limit with storage capacity to check how and when it will crash.

Gorilla Testing

Gorilla testing is a type of testing wherein a module is tested repeatedly to ensure that its functionality is working fine. Developers can also do gorilla testing.

Recovery Testing

A type of testing that validates the recovery of data. How an application recovers data in case of crash or disaster.

Regression Testing

A type of testing that validates the functionality of a system as a whole after some modifications or changes. In regression testing, we verify that existing functionalities are working fine or not.

Security Testing

A type of testing is used to verify the security of a system. A special team performs security testing. It is done by penetrating different combinations of data in a hacking way. It helps us to protect our system from external threats. It also ensures that how our systems are secure from viruses and malicious programs.

Usability Testing

A testing technique is used to verify the look and feel of the software. Application is tested with a user point of view, that how much application is user friendly. A new user can understand easily or not. If an application is user friendly, then it will be easier for new users to use it. The application's navigation systems should be more clear for a layman.

Volume Testing

A type of non-functional testing is performed by a performance testing team. The application is tested by giving large amounts of data. Systems response time and behavior are measured when it comes across a huge volume of data.

Negative Testing

A testing technique which is used to break the system by providing negative inputs. Negative or incorrect data is used to check the system response. How it behaves in case of incorrect data.

Mutation Testing

Mutation testing is a type of white box testing where the source code of one program is changed and existing test cases identify the defects. Changes are done on a small scale so that the entire application's functionality would not be affected.

Happy Path Testing

A type of software testing which ensures that positive flows of application are working fine. No negative inputs are used in happy path testing. The main focus is only on the valid and positive inputs through which application generates the expected results.

Installation Testing

Installation testing is used to validate that systems are installed successfully and its functionality is working as expected.

Reliability Testing

A software testing technique ensures that how much the system is reliable and can it perform failure-free operations for a specific span of time in a particular environment.


Above mentioned testing types are used most commonly. There is still a long list of testing types, but not all testing types are used in all types of projects. We have covered the most common which are used in the software testing life cycle.

Software Testing Hierarchy

The Hacks of The Day














Software Testing Levels

In software testing, we go through different levels of testing. The main purpose of this hierarchy is to verify that the application is working fine and meeting the user requirements. So to produce a quality product we need different levels of testing. The various levels of testing are:

Unit Testing

A type of testing which ensures that all major functionalities of the application are working fine. It is also called “Build Verification Testing”. The purpose of smoke testing is just to ensure that we are good to proceed with the detailed testing.

Component Testing

Component testing is also called as module testing. The difference between the unit testing and component testing is, in-unit testing the developers test their code but in component testing, the whole component is tested. In component testing, we ensure the quality of the whole component.

Integration Testing

Integration testing is carried out when two or more than two modules are integrated, in order to test the behavior and functionality of both the modules after integration to ensure that they are working fine after integration.

System Testing

System Testing is a process that validates the system as a whole. System testing is carried out when all the components are integrated. Testers evaluate the system's compliance with its specified requirements. Testing is done as a System instead of individual components.


Acceptance Testing

Acceptance testing is basically done to ensure that the system is ready to operate in the real environment. 
  • Alpha Testing: Testing that is carried out at the developer's site is called alpha testing. It is done at the end of the development process.
  • Beta Testing: Beta testing is done by end-users. It is done just before the launch of the product.

More Testing Types

  • Regression Testing
  • Buddy Testing
  • Alpha Testing
  • Beta Testing

Summary

  • A level of software testing is a process where every unit or component of a software/system under development is tested.
  • The primary goal of system testing is to evaluate the system's functionality with the specified needs.
  • There are four main levels of testing are Unit Testing, Integration Testing, System Testing, and Acceptance Testing.


Software Testing Basics

The Hacks of The Day

Software Testing Basics: Software testing is a process to check the quality of the software and to reduce the risk of software failure in operation. To execute the application/program with the intent of finding bugs.

Software testing is a process that includes various activities like:

  • Review of SRS document
  • Test Planning
  • Test Case Designing
  • Execution of Test Plan
  • Execution of Test Cases
  • Bug Reporting


Static Testing: A testing technique that is used to test the system without code execution is called static testing.

Dynamic Testing: Testing that involves the execution of a component or system being tested is called dynamic testing.

“Testing also includes reviewing the requirements, user stories, and source code.”

Software Testing also used to validate the System, which is checking whether the system will meet the user's requirements in its operational environment.

Testing and debugging are two different things. Testing is a process that finds defects in the software system. Debugging is done by the developers that find, analyze, and fix the defects.

Why Testing is Necessary?

Software testing is a necessary part to make an application defect free. The following are the main reasons why testing is necessary.

To produce a quality product
To make an application bug free
To meet the user requirements
To check that functionality is working fine
To check the performance of the application
To find out the defects that were made during development

What is Error?

A mistake in coding is called error. A mistake that is made by developers while developing a software component or system. This could happen because of the following reasons

Misunderstanding of software functionality
Miscalculation of values
Misinterpretation of any value

What is Bug/Defect?

An error that is found while testing an application is called a defect. In simple words the variance between the expected and actual result.
Defect or Bug report consists of the following information

Bug ID: Each bug contains a unique identification number.

Bug Title/Summary: A brief description of the bug.

Bug Description: Detailed information on the bug with reproduction steps.

Priority: It can be High/Medium/Low based on the urgency of bug.

Severity: It can be Critical/Major/Minor based on the impact of the bug on application.

Attachment: Screen-shots/Videos are attached for a better description of the bug.

Bug Life Cycle:

A cycle in which a bug goes through during its lifetime. This cycle contains many stages which are given below

New: When a bug is logged in any bug reporting tool, it is given a “New” state.

Assigned: When a bug is posted, then Developer lead or Manager assigns it to the available

developer. It is given an “Assigned” state.

Open: When a developer starts working on that bug, it goes into the “Open” state.

Fixed: When a bug is fixed by the developer then he makes the bug status as “Fixed” and the bug is passed to the testing team.

Retest: After the bug is fixed by the developer, tester retest the changes.

Verified: When a bug is passed by the tester, then the state of the bug changed to “Verified”.

Closed: After PM verification if things are going well, then it gave a state “Closed”.

Duplicate: If the same bug is logged twice or the two bugs mention the same concept of the bug, then one bug status changed to "duplicate".

Rejected: If a bug is not genuine, then the developer rejects the bug. Then the bug goes to the “rejected” state

Deferred: The state of the bug is changed to “deferred” when it does not belong to the current sprint”. It means it will be fixed in the next sprint.

Not a bug: The status is given as "Not a bug" if the tester reports a bug that is not in actual.


What is Failure?

The inability of the software to work in a production environment. The system deviates from the expected results.

Software Testing Basic Questions

What is software testing
Why is software testing important?
When should you do software testing?
How much testing is enough?
Why does software have defects?
When can we stop testing?
When should we start testing?
Can we make an application 100% bug-free?