Latest Event Updates

Software Testing Basic Concept

Posted on Updated on

What is testing?

In general term testing is finding out how well something works. In terms of human beings, testing tells what level of knowledge or skill has been acquired. In Hardware and software, testing is used at key checkpoints in the overall process to determine whether requirements are being met.

What is Software Testing?

  1. It is stated as the process of validating and verifying that a software/Program/Application or Product:
  •  Works as expected according to the business and technical requirements.
  •  Works Consistently and Predictably.
  1. It is not sufficient to demonstrate that the software is doing what it is supposed to do. It is more important to demonstrate that the software is not doing what it is not supposed to do.
  1. It is process of finding defects i.e. variance between Expected result and Actual results. And process of executing a software program application with intent of finding errors.

Why is Testing necessary?

User don’t like bugs, so testing

Software testing is necessary to make sure the product or application is defect free, as per customer specifications. Software testing identifies faults whose removal increases the software quality and increases the software reliability.

Testing effort is directly proportional to the complexity of the program. More complex the program, more the testing effort is required.

Software Testing is necessary, because software should be: –

–          Error Free

–          Efficient

–          Secured

Software Testing is important as it may cause mission failure, Impact on operational performance and unreliable if not done properly.

When Testing Start?

Testing start right from the requirement phase and continue till the release time. The main objective of early starting, if requirement related defects caught later in the SDLC result in higher cost to fix the defect.

How we can do Testing?

There is two way for testing.

  1. Manual Testing: – In Manual Testing, Testers manually execute test cases and find defect  without the uses of any tools or Automation scripts.

 

2.  Automation Testing: – It is a process of instructing a tool to perform an operation on an      application under test. Test automation is the use of software to control the execution of  tests & the comparison of expected v/s actual result.

Thanks…..

Write data in .xls and .xlsx (Excel) file using POI

Posted on

As we know that file is very most important in our day to day life, we frequently use to create a file, open it and update or delete something from file. Same thing in selenium automation as well we need to manipulate the file.

So, In this blog we will learn how to install the poi jar file, what jar file are required for that and how to perform the read operation on excel with the help of JAVA IO package and APACHE POI library.

POI library is enough to read write both XLS and XLSX file.

Note : For .XLS file read write, we can use .JXL jar file but it won’t support to .xlsx file.

 

Let’s begin the journey: – 

Step 1. If you haven’t eclipse then Install the Eclipse latest version.

Step 2. If you haven’t added WebDriver then download the webdriver jar file and add to library.

Step 3. If you are using Maven then use the following dependencies.

                           <!– https://mvnrepository.com/artifact/org.apache.poi/poi –>

                                                        <dependency>

                                                                <groupId>org.apache.poi</groupId>

                                                                <artifactId>poi</artifactId>

                                                                <version>4.0.1</version>

                                                         </dependency>

Or else you can directly download latest POI jar file from https://poi.apache.org/download.html

Step 4. Once the downloaded jar file then unzip the file and add library file into your project.

Right click on your project -> Build Path -> Configure Build Path-> Library -> Add External Jar-> ok

Note: Below are java interfaces and classes that we will use for read/write xls and xlsx file in POI

XSSFWorkbook : – Is a class representation of XLSX file.

HSSFWrokbook  : – Is a class represent of XLS file.

XSSFSheet :- XSSFSheet classes implement this interface represent XLSX file’s sheet.

HSSFSheet : – HSSFSheet classes implement this interface XLS file’s sheet.

XSSFRow :- XSSFSheet classes implement this interface represent to a row of XLSX file.

HSSFRow : – HSSFSheet classes implement this interface represent to a row of XLS file.

XSSFCell :- XSSFSheet classes implement this interface represent a cell in a row of XLSX file.

HSSFCell : – HSSFSheet classes implement this interface represent a cell in a row of XLS file.

 

Write Data in Excel sheet

package Account;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

 

import org.apache.poi.xssf.usermodel.XSSFCell;

import org.apache.poi.xssf.usermodel.XSSFRow;

import org.apache.poi.xssf.usermodel.XSSFSheet;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;

 

public class WriteInExcel {

public static void main(String args[])throws IOException{

 

String ctVal= “Status”;

 

// File Location

File src = new File(“D://Dazeworks//Selenium Projects//Credential.xlsx”);

// Open File using FileInputStream class

FileInputStream fis = new FileInputStream(src);

 

// Create Workbook instance holding reference to .xlsx file

XSSFWorkbook workbook = new XSSFWorkbook(fis);

 

// Get first/desired sheet from the workbook

XSSFSheet sheet = workbook.getSheetAt(0);

// Entering a value in Row[0] and Cell[4]. Here cell is nothing but Column number

sheet.getRow(0).createCell(4).setCellValue(ctVal);

 

// If user want to enter value as per choice row then Needs to create row where he wants to get enter the value

XSSFRow r = sheet.createRow(14);

//Create a cell for the value where you want to enter.

XSSFCell c = r.createCell(10);

//Entering the Value for particular cell

c.setCellValue(“How’s Josh????”);

//Using FileOutputStream we will get in which file we have to write

FileOutputStream fos = new FileOutputStream(src);

// Writing in the values in workbook

workbook.write(fos);

//File close

fos.close();

 

System.out.println(“Value inserted successfully”);

}

 

}