Saturday 29 June 2019

Automation Testing : Roles and Responsibilities

                        Roles and Responsibilities

Below are some roles and responsibilities for Automation tester.

Roles & Responsibilities:
  • Understanding the business requirements, application and its components.
  • Updating Framework functions when needed
  • Developed and executing the Automation Test Scripts
  • Reviewing the Test Reports and Preparing Test Summary Report.
  • Preparation of test scenarios/cases/execution and test results.
  • Reporting any defects / Observation on day to day basis
  • Attending the client calls and meetings
  • Involving in giving daily and weekly status reports to clients.
  • Involved in knowledge transfer to the newly recruited personnel.
  • Implemented automation using Selenium WebDriver, JAVA, Selenium Grid, Cucumber, Maven.
  • Extensively automated regression and functional test suites by developing over 237 test cases, 6 test suites using Selenium WebDriver, JAVA, JUnit.
  • Implemented Page Objects framework, Hybrid framework and 21 Page classes from scratch to represent web pages.
  • Developed Keyword Driven and Data Driven frameworks to retrieve test actions, test data from Excel files and SQL Databases.
  • Configured Maven for JAVA automation projects and developed Maven project object model (POM).
  • Used Maven, Selenium Grid to execute Selenium automation suites on different platform, browser combinations in parallel.
  • Developed BDD tests using Cucumber by writing behaviours and step definitions. Developed required Selenium support code in JAVA for Cucumber.
  • Wrote SQL queries extensively, queried database and generated test reports. Performed Purchase Orders Database testing by developing 14 SQL scripts.
  • Performed Defect Tracking & Management in JIRA. Generated automated daily reports using JIRA API.
  • Worked in a highly dynamic AGILE environment and participated in scrum and sprint meetings
  • Assisted Manager by providing automation strategies, Selenium/Cucumber Automation and JIRA reports.
  • Identified weaknesses in QA Processes, Web testing, Selenium Automation. Suggested & implemented improvements
  • Building automation regression test suite for the application which can be executed during each sprint release
  • Developing re-usable methods for repeating steps
  • Automated highly transactional e-commerce web application using Selenium WebDriver.
  • Implemented Page Objects, Data Driven, Keyword Driven, Hybrid automation frameworks using Selenium WebDriver, JAVA, JUnit.

Resume Summary
  • Expertise in Selenium automation using Selenium WebDriver, Selenium Grid, JAVA, JUnit & Maven
  • Designed and implemented different automation frameworks from starch like Page Objects framework, Keyword Driven framework, Data Driven framework and Hybrid framework for a number of projects
  • Expertise in writing Selenium WebDriver automation scripts in JAVA for highly transactional E-commerce websites
  • Executed automation scripts on different browsers/environments & reported defects/results to the team
  • Proven ability in developing BDD scripts with Cucumber and writing step definitions for behaviour
  • Maintained the Selenium & JAVA automation code and resources in source controls like CVS, SVN over the time for improvements and new features
  • Took ownership of automation and led the automation team by mentoring the team as required
  • Excellent experience of build tools like Maven and managing JAVA automation projects using them
  • Experience in interacting directly with End User Clients
  • Experience in working on Page Object model framework using selenium web driver
  • Involved in knowledge transfer to the newly recruited persons.
  • Experience in providing internal training on Selenium Tool
  • Experience in working selenium with TestNG
  • Automated highly transactional e-commerce web application using Selenium WebDriver.
  • Implemented Page Objects, Data Driven, Keyword Driven, Hybrid automation frameworks using Selenium WebDriver, JAVA, JUnit.



Monday 17 June 2019

Data driven testing - Get value from excel in selenium

Data Driven Testing in Selenium


We require to perform Data driven testing many times while running selenium scripts.Below is the best method to fetch data from excel sheet and write in another excel sheet.

We can perform data driven using excel file with help of Apache POI library.

Java Code for Data driven Testing :

 

package com.seleniumblog.selenium.test;

import java.io.*;
import java.util.concurrent.TimeUnit;

import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class DataDriven{

 public static void main(String[] args) {

        WebDriver driver = new FirefoxDriver();

        driver.get("http://www.google.com");

        driver.manage().window().maximize(); 
      
        WebElement searchbox = driver.findElement(By.name("q"));

 try {
   
  FileInputStream file = new FileInputStream(new File("C:\\data.xlsx"));
  XSSFWorkbook workbook = new XSSFWorkbook(file);

  XSSFSheet sheet = workbook.getSheetAt(0);

for (int i=1; i <= sheet.getLastRowNum(); i++){

        String keyword = sheet.getRow(i).getCell(0).getStringCellValue();

        searchbox.sendKeys(keyword);

        searchbox.submit();      
 
        driver.manage().timeouts().implicitlyWait(1000, TimeUnit.MILLISECONDS);

}

  workbook.close();
  file.close();

 } catch (FileNotFoundException fe) {
  fe.printStackTrace();
 }
 }
}

 

So now lets see how the above code works:

Below code is the required packages for JAVA IO to make integration with excel file and Timeunit.

   
import java.io.*;
import java.util.concurrent.TimeUnit;

Below code is the required packages for Apache POI library.

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

Below code is the required packages for Selenium.

   
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
Following code is to initialize the Firefox driver.

WebDriver driver = new FirefoxDriver();

Below code is to open the hello selenium blog in browser.
 

driver.get("http://www.google.com");

You can also use the Below code is to open the hello selenium blog in browser.

driver.navigate().to("http://www.google.com");

Below code is to maximize the Firefox Driver instance.
   
driver.manage().window().maximize();

Below code is to store WebElement into a variable.
   
WebElement searchbox = driver.findElement(By.name("md"));

Below code is to locate the path of excel file.

FileInputStream file = new FileInputStream(new File("C:\\testdata.xlsx"));

Below code is to initialize the excel file as a workbook.

   
XSSFWorkbook workbook = new XSSFWorkbook(file);

Below code is to initialize the excel sheet of the workbook. Here 0 (zero) refers to the first sheet of the workbook.
   
XSSFSheet sheet = workbook.getSheetAt(0);

Below code is to run the loop till it found cell value of last row.

   
for (int i=1; i <= sheet.getLastRowNum(); i++)

Below code is to get the keyword value from the worksheet.

String keyword = sheet.getRow(i).getCell(0).getStringCellValue();

Below code is to type the keyword into search textbox.


input.sendKeys(keyword);

Below code is to press RETURN within textbox.
   
input.submit();

Below code is wait for 10 seconds.

   
driver.manage().timeouts().implicitlyWait(100, TimeUnit.MILLISECONDS);

You can also use the Below code is to close the excel file.

   
workbook.close();
file.close();

For more data driven testing , follow this web page.

 

 

Wednesday 5 June 2019

Cucumber Testing in Selenium : Tutorial

Cucumber Testing and Framework


What is Cucumber Testing?

Cucumber Testing or Cucumber framework or Selenium with cucumber and java is powerful combination with respect to Web Application automation testing. Cucumber tool is easy to learn and implement as well.Cucumber is written in a language known as 'Gherkin'.As it is easy to implement and language usage which is near to common English language. Now lets start with the tutorials what is cucumber testing and followed by cucumber test example.

Cucumber feature file

Feature file is a text file that is created in project structure which will have extension as '.feature'. This is the file where we are suppose to write cucumber steps that we are following for a scenario and each step will be link to a action that has to be performed in step definition package. Feature file starts with Feature: name of the scenario with regression or sprint test case what is being done for eg. Testing new web application or module followed by testing - regression or sanity. Scenario can be written with Given, When, Then , And.


Cucumber BDD test example :

Below is the cucumber testing tutorial where we are writing a feature file with all the tags required and then will try to execute and get the output. Here each step will execute a method which it is linked in step definition file.

Feature: What are we testing

Scenario: Scenario or test scenario (Login to web applicaiton)

Given URL is opened
When user enter valid credentials
Then user must be successfully logged in

Here if we read the scenario, it is pretty much clear that what this script will going to execute.Now there will be no programming language constrain and is easy to understand for bussiness as well.

Now, we have step defination package, which will consist of class that will get executed once a step is performed. Like if we have Given Url is opened then we have a specific method say openURL() which will get triggered once under execution. Similarly if we have a step enter credentials then that step will be linked to a method say enterCredentials(). Like this we create a link between the steps and relevant method that needs to be executed.

Other thing that we have is runner class which is used for execution of scenarios present in feature file. This is done with the help of tag that we provide in runner class that start the relevant scenario with the tags. Now if we want to execute the above example so we need to first add tag in the runner class lets say tag is {"sanity"} and same has to be added to each scenario  that we need to execute.

@sanity
Scenario: What is the scenario


Given Url is opened
When user enter valid credentials
Then user must be successfully logged in


Thats all what is required to start with Cucumber testing tool, now lets see with help of an example in next post.