• Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language
    HTML
  • Created about 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learn Automation Testing with Java and Selenium

Learn Automation Testing with Java and Selenium

Course Link : https://www.udemy.com/course/automation-testing-with-selenium-and-java-for-beginners/

Your First Steps towards Great Automation Tester

Course Checklist

Getting Started

Installing Tools

Running Examples

  • Download the zip or clone the Git repository.
  • Unzip the zip file (if you downloaded one).
  • Open Command Prompt and Change directory (cd) to folder containing pom.xml
  • Open Eclipse
    • File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
    • Select the right project
  • Choose the Spring Boot Application file (search for file with @SpringBootApplication)
  • Right Click on the file and Run as Java Application
  • You are all Set
  • For help : use our installation guide - https://www.youtube.com/playlist?list=PLBBog2r6uMCSmMVTW_QmDLyASBvovyAO3

References

Selenium Standalone

Installation and Launch
  • Step I : Install NPM
  • Step II : Install selenium-standalone Terminal or Command Prompt
# In Windows, Run CMD as Administrator

npm install selenium-standalone@latest -g
# If need use sudo npm install selenium-standalone@latest -g

selenium-standalone install
# if needed use sudo 
  • Step III : Launch Selenium Standalone
selenium-standalone start

By default, google chrome, firefox and phantomjs are available when installed on the host system

# install a single driver within the default list (chrome, ie, edge, firefox) 
selenium-standalone install --singleDriverInstall=chrome

Reference

Selenium Grid

Installation and Launch
  • Follow Step I and II of Selenium Standalone
  • Step III
selenium-standalone start -- -role hub
selenium-standalone start -- -role node -hub http://localhost:4444/grid/register
selenium-standalone start -- -role node -hub http://localhost:4444/grid/register -port 5556

selenium-standalone start -- -role node -hub http://localhost:4444/grid/register -browser browserName=firefox

selenium-andalone start -- -role node -hub http://localhost:4444/grid/register -port 5556 -browser browserName=chrome,maxInstances=2

Code Snippets

Maven Dependencies
JUnit
  <dependencies>
  
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.13.0</version>
      <scope>test</scope>
    </dependency>

  
    <!-- https://github.com/bonigarcia/webdrivermanager -->
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>webdrivermanager</artifactId>
      <version>2.2.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.13</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
  
  </dependencies>
Test NG
  <dependencies>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.13.0</version>
      <scope>test</scope>
    </dependency>

    <!-- https://github.com/bonigarcia/webdrivermanager -->
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>webdrivermanager</artifactId>
      <version>2.2.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.13</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.14.3</version>
      <scope>test</scope>
    </dependency>

  </dependencies>
Other Dependencies
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.10.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.opencsv</groupId>
      <artifactId>opencsv</artifactId>
      <version>3.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>3.6</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi-ooxml</artifactId>
      <version>3.6</version>
      <scope>test</scope>
    </dependency>
Java Code
Chrome Driver
  ChromeDriverManager.getInstance().setup();
  driver = new ChromeDriver();
Firefox Driver
  FirefoxDriverManager.getInstance().setup();
  driver = new FirefoxDriver();
Excel Data Reader
package com.in28minutes.datadriventests;

import java.io.File;

import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public class ExcelReadUtil {
  public static String[][] readExcelInto2DArray(String excelFilePath, String sheetName, int totalCols) {

    File file = new File(excelFilePath);

    String[][] tabArray = null;

    try {
      OPCPackage opcPackage = OPCPackage.open(file.getAbsolutePath());

      Workbook wb = WorkbookFactory.create(opcPackage);

      Sheet sheet = wb.getSheet(sheetName);

      int totalRows = sheet.getLastRowNum() + 1;

      tabArray = new String[totalRows][totalCols];

      for (int i = 0; i < totalRows; i++) {
        for (int j = 0; j < totalCols; j++) {
          Cell cell = sheet.getRow(i).getCell(j);
          System.out.println(cell + " " + i + " " + j);

          if (cell == null)
            continue;

          switch (cell.getCellType()) {
          case Cell.CELL_TYPE_BOOLEAN:
            tabArray[i][j] = String.valueOf(cell.getBooleanCellValue());
            break;
          case Cell.CELL_TYPE_NUMERIC:
            tabArray[i][j] = String.valueOf(cell.getNumericCellValue());
            break;
          case Cell.CELL_TYPE_STRING:
            tabArray[i][j] = cell.getStringCellValue();
            break;
          default:
            tabArray[i][j] = "";
            break;
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }

    return tabArray;
  }

}
TestNG (testng.xml)
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="First Suite" verbose="1">
</suite>
AbstractChromeWebDriverTest
package com.in28minutes.webdriver.basics;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import io.github.bonigarcia.wdm.WebDriverManager;

public abstract class AbstractChromeWebDriverTest {

  protected WebDriver driver;

  public AbstractChromeWebDriverTest() {
    super();
  }

  @BeforeTest
  public void beforeTest() {
    //Download the web driver executable
    WebDriverManager.chromedriver().setup();
    
    //Create a instance of your web driver - chrome
    driver = new ChromeDriver();
  }

  @AfterTest
  public void afterTest() {
    driver.quit();
  }
  
  public void sleep(int seconds) {
    try {
      Thread.sleep(seconds * 1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }

}

Resources

Plugins
Selenium IDE
Troubleshooting
Browsers

Overview

Introduction

Writing your first automation test is a lot of fun.

Java is one of the most popular programming languages. Java offers both object oriented and functional programming features. Selenium can be used for screen scraping and automating repeated tasks on browser.

In this course, you will learn the basics of programming with Java and Automation Testing with Selenium.

We take an hands-on approach using Eclipse as an IDE to illustrate more than 200 Java Coding Exercises, Puzzles and Code Examples. We will also write more than 100 Selenium automation tests with Java for a wide variety of scenarios.

In more than 350 Steps, we explore the most important Java Programming Features and Selenium Automation Testing Scenarios

  • Basics of Java Programming - Expressions, Variables and Printing Output
  • Using Selenium IDE and Katalon Studio to Record and Replay Automation Testing Scenarios
  • Exporting Automation Tests and Setting up new Maven Project for JUnit and TestNG
  • TestNG vs JUnit
  • TestNG Advanced Features - XML Suite, Test Reports, Running Tests with Parameters defined in XML and Running Tests in Parallel
  • Basics of HTML, CSS and XPath
  • Selenium Locators - By Id, By Name, By Link Text, By Partial Link Text, By Class, CSS Selectors and XPath Expressions
  • Setting and Reading values from Form Elements - Text, TextArea, CheckBox , Radio Button, Select Box and Multi Select Box
  • Advanced Selenium Automation Testing Scenarios - Playing with Windows, Modal Windows (Sleep, Implicit Wait and Explicit Waits), Alert Boxes, Window Handles and New Browser Window Launches, Frames, Taking Screenshots, Executing JavaScript Code, Actions Interface to control mouse and keyboard
  • Set up Automation Testing Frameworks - Tables
  • Important Interfaces - WebDriver
  • Introduction to Cross Browser Automation Testing, Headless Testing and Setting up a Basic Cross Browser Automation Testing Framework
  • Writing Data Driven Testing with Data Providers, CSV and Excel Spreadsheets
  • Implementing Page Object Model for a Complex Test Scenario
  • Scaling up with Selenium Standalone and Grid
  • Java Operators - Java Assignment Operator, Relational and Logical Operators, Short Circuit Operators
  • Java Conditionals and If Statement
  • Methods - Parameters, Arguments and Return Values
  • An Overview Of Java Platform - java, javac, bytecode, JVM and Platform Independence - JDK vs JRE vs JVM
  • Object Oriented Programming - Class, Object, State and Behavior
  • Basics of OOPS - Encapsulation, Abstraction, Inheritance and Polymorphism
  • Basics about Java Data Types - Casting, Operators and More
  • Java Built in Classes - BigDecimal, String, Java Wrapper Classes
  • Conditionals with Java - If Else Statement, Nested If Else, Java Switch Statement, Java Ternary Operator
  • Loops - For Loop, While Loop in Java, Do While Loop, Break and Continue
  • Java Array and ArrayList - Java String Arrays, Arrays of Objects, Primitive Data Types, toString and Exceptions
  • Java Collections - List Interface(ArrayList, LinkedList and Vector), Set Interface (HashSet, LinkedHashSet and TreeSet), Queue Interface (PriorityQueue) and Map Interface (HashMap, HashTable, LinkedHashMap and TreeMap() - Compare, Contrast and Choose
  • Generics - Why do we need Generics? Restrictions with extends and Generic Methods, WildCards - Upper Bound and Lower Bound.
  • Introduction to Exception Handling - Your Thought Process during Exception Handling. try, catch and finally. Exception Hierarchy - Checked Exceptions vs Unchecked Exceptions. Throwing an Exception. Creating and Throwing a Custom Exception - CurrenciesDoNotMatchException. Try with Resources - New Feature in Java 7.

You will be using Eclipse and Brackets as the IDE. You will be using Maven, npm (Dependency Management), TestNG (XML Test Suite, Parallel, Multiple Browsers), JUnit, Selenium IDE, Katalon Studio, Selenium Standalone and Selenium Grid. We will help you set up each one of these.

  • Tools : Maven, JUnit, TestNG (XML Test Suite, Groups, Listeners, Parallel, Multiple Browsers), Selenium IDE, Katalon Studio, Brackets
  • Concepts : HTML, DOM, XPath, Selenium Architecture, Reporting (HTML), Parallel Execution (Data Driven Tests, Browsers, Test Ng, Grid), Debugging (Screenshots/logs), Page Object Model, Data Driven(Excel), Keyword Driven, Record and Replay, Selenium Grid, Cross Browser Testing, DRY
  • Basics : Selenium Web Driver, Locating Web Elements(link text, name, id, xpath, css), Different Elements(select, radio, web tables, drag and drop, javascript alerts, windows, popups, iframes, switching windows), Wait (Explicit/Implicit), JavaScript Executor Action Class, Mouse movement, Keyboard with Selenium)
  • Tips : Selenium Web Driver is an Interface, Headless Testing(PhantomJS, Chrome)

What You will learn

  • You will learn how to think as a Java Programmer
  • You will learn how to start your journey as a Java Programmer
  • You will learn the basics of Eclipse IDE and JShell
  • You will learn to develop awesome object oriented programs with Java
  • You will learn to use Selenium IDE and Katalon Studio to Record and Replay Automation Testing Scenarios
  • You will learn to setup new automation projects with Selenium, Web Driver, JUnit and TestNG Frameworks
  • You will learn some of the TestNG Advanced Features - XML Suite, Test Reports, Test Parameters and Parallel Execution
  • You will learn the basics of HTML, CSS and XPath
  • You will understand all Selenium Locators - By Id, By Name, By Link Text, By Partial Link Text, By Class, CSS Selectors and XPath Expressions
  • You will learn to play with Form Elements - Text, TextArea, CheckBox , Radio Button, Select Box and Multi Select Box
  • You will learn to write automation test for wide range of scenarios - Playing with Windows, Modal Windows (Sleep, Implicit Wait and Explicit Waits), Alert Boxes, Window Handles and New Browser Window Launches, Frames, Taking Screenshots, Executing JavaScript Code, Actions Interface to control mouse and keyboard
  • You will learn to Set up Automation Testing Frameworks for Form Elements, Tables and Cross Browser Testing
  • You will learn to write Data Driven Tests with Data Providers, CSV and Excel Spreadsheets
  • You will learn to implement Page Object Model for a Complex Automation Test Scenario
  • You will learn to parallelize and scale up Automation Tests with Selenium Standalone and Grid

Requirements

  • You should have the ability to learn while having fun!
  • Connectivity to Internet to download various tools needed.
  • We will help you install Selenium IDE, Katalon Studio, Brackets, Java, NodeJs and Eclipse.
  • We will help you download all needed dependencies using Maven and NPM

Step Wise Details

00 - Overview

  • 00 - 00 Introduction to Automation Testing with Java and Selenium
  • 00 - 01 Automation Testing with Java and Selenium - Course Guide.pdf
  • 00 - 02 How To Make Best use of the Course Guide?
  • 00 - 03 Installing Java and Eclipse

01 - Getting Started with Selenium, JUnit and TestNG

  • Step 01 - Getting Started with Selenium - An Overview
  • Step 02 - Installing Selenium IDE
  • Step 03 - Recording and Replaying Google Search with Selenium IDE
  • Step 04 - Exercise - Recording Facebook Login
  • Step 05 - Advanced Features in Selenium IDE
  • Step 06 - Alternative for Selenium IDE - Katalon Studio
  • Step 07 - Installing and Recording Tests with Katalon Studio
  • Step 08 - Advanced Features of Katalon Studio
  • Step 09 - Export Unit Tests and Set up new Maven Project
  • Step 10 - Adding Maven Dependencies for JUnit, Web Driver Manager and Web Driver
  • Step 11 - Fixing Driver Error with ChromeDriverManager
  • Step 12 - Exercise - Run Facebook JUnit Test
  • Step 13 - Running a Selenium Automation Test - What is happening in Background
  • Step 14 - Install TestNG Plugin and Create New Project with TestNG
  • Step 15 - Export and Run TestNG Test for Google and Facebook
  • Step 16 - Comparing TestNG and JUnit Tests and Course Overview

02 - TestNG vs JUnit

  • Step 01 - Introduction to TestNG vs JUnit
  • Step 02 - Creating a Unit Test for SimpleClass
  • Step 03 - Adding Asserts to Unit Test
  • Step 04 - Exercise - Write more unit test Scenarios
  • Step 05 - Writing Selenium JUnit Automation Test for Google - Part 1
  • Step 06 - Writing Selenium JUnit Automation Test for Google - Part 2
  • Step 07 - Exploring WebDriver Interface
  • Step 08 - Writing Selenium JUnit Automation Test for Google - Part 3
  • Step 09 - Reducing Duplication with @Before and @After JUnit Annotations
  • Step 10 - Time for TestNG - Convert Unit Test to TestNG
  • Step 11 - TestNG Advanced Features - XML Suite and Test Reports
  • Step 12 - TestNG Advanced Features - Running Tests with Parameters defined in XML
  • Step 13 - TestNG Advanced Features - Running Tests in Parallel

03 - Getting Started with HTML, CSS and XPath

  • Step 01 - Why should you learn HTML and CSS
  • Step 02 - How does Web Work - Request, Response, HTML and Browser
  • Step 03 - Installing Web Editor - Brackets
  • Step 04 - First HTML File - Tags, HTML, Head and Body
  • Step 05 - Basic HTML Tags - Paragraph, Div, Heading - H1 to H6
  • Step 06 - Formatting Tags - Bold, Italicized and Quotes
  • Step 07 - Using Tags without closing tag - BR and HR
  • Step 08 - W3C Standards for HTML
  • Step 09 - Creating List of elements with UL LI and OL
  • Step 10 - Organizing Your Data Using Tables
  • Step 11 - Organizing Your Data Using Tables - Exercise Solutions
  • Step 12 - HTML Attributes and Links - Absolute and Relative
  • Step 13 - Image Tag in HTML - Local and Internet Links
  • Step 14 - Introduction to Live Preview Feature in Brackets
  • Step 15 - Nesting of Divs and Understanding align Attribute
  • Step 16 - Getting Data from User using Forms - Text and TextArea
  • Step 17 - Attributes on Text Elements - Size, maxlength, value
  • Step 18 - Choosing among multiple options using Radio Buttons
  • Step 19 - Choosing among multiple options using Select Box
  • Step 20 - Choosing Yes or No with Check Box
  • Step 21 - Submitting a Form and Understanding GET and POST
  • Step 22 - Introduction to Frames
  • Step 23 - Miscellaneous - Password Fields, File Input and Multi Select Box
  • Step 24 - Introduction to CSS
  • Step 25 - CSS for input, select and text area
  • Step 26 - CSS attributes with color, background color
  • Step 27 - Grouping Form Elements with fieldset
  • Step 28 - Styling Fieldsets with CSS
  • Step 29 - Exercise - Styling Lists
  • Step 30 - Using an External CSS File
  • Step 31 - Understanding Class in CSS
  • Step 32 - Making best use of Class in CSS and Multiple Classes
  • Step 33 - Using id with CSS
  • Step 34 - Understanding CSS Selectors and Testing using $$ function
  • Step 35 - CSS Selectors - Identifying Input Element
  • Step 36 - Introduction to XPath Expressions - Absolute and Relative
  • Step 37 - Using id and class in XPath Expressions
  • Step 38 - Using XPath on the Forms Page
  • Step 39 - A Review of XPath Expressions and CSS Selectors

04 - Setting up First Web Application

  • Step 01 - Setting up First Web Application
  • Step 02 - Refactoring Shortcuts To Learn
  • Step 03 - My Favorite Shortcuts - Ctrl + 1 and Ctrl + Space

05 - Selenium Automation - Locators

  • Step 01 - Introduction to the Section
  • Step 02 - Setting up New Project with TestNG
  • Step 03 01 - Selenium Locators - Locate Elements By Id and WebElement Interface
  • Step 03 02 - Exercise - Selenium Locators - Locate Elements By Id
  • Step 04 - Selenium Locators - Locate Elements By Name - Part 1
  • Step 05 - Selenium Locators - Locate Elements By Name - Part 2
  • Step 06 - Abstracting @BeforeTest and @AfterTest to common super class AbstractChromeWebDriverTest
  • Step 07 - Debugging Errors - Element Not Found Exception
  • Step 08 - Selenium Locators - Locate Elements By Tag Name
  • Step 09 - Finding Multiple Matching Elements with findElements
  • Step 10 - Finding Multiple Matching input Elements
  • Step 11 - Slowing Tests using sleep for visualizing
  • Step 12 - Automation Test for Entering UserId and Password and Logging in from Login Page
  • Step 13 - Exercise - Create Automation Test fo Login Static Page
  • Step 14 - Selenium Locators - Locate Elements By Link Text
  • Step 15 - Selenium Locators - Locate Elements By Partial Link Text
  • Step 16 - Selenium Locators - Locate Elements By Class
  • Step 17 - Exercise - Selenium Locators - Locate Elements By Class
  • Step 18 - Selenium Locators - Locate Table Element
  • Step 19 - Exercise - Selenium Locators - Locate and Click Table Element
  • Step 20 - Understanding CSS Selectors for Table Data - td
  • Step 21 - Using XPath Expressions to Locate Table Elements
  • Step 22 - Choosing among multiple Selenium Locator Options
  • Step 23 - Improving Performance By Caching WebElements
  • Step 24 - Conclusion

06 - Selenium Automation - Playing with Form Elements

  • Step 01 - Introduction to Section
  • Step 02 - Reading and Setting values into Text Elements using Selenium Web Driver Interface
  • Step 03 - Reading and Setting values into TextArea Elements using Selenium Web Driver Interface
  • Step 04 - Reading value of CheckBox in Automation Tests
  • Step 05 - Setting value of CheckBox in Automation Tests
  • Step 06 - Creating Framework Utility Method for CheckBox in Automation Tests
  • Step 07 - Reading value of Radio Button in Automation Tests
  • Step 08 - Setting value of Radio Button in Automation Tests
  • Step 09 - Reading value of Select Box
  • Step 10 - Reading value of Multi Select Box
  • Step 11 - Setting value of Select Box in Automation Test
  • Step 12 - Conclusion

07 - Selenium Automation - Advanced Testing Scenarios

  • Step 01 - Introduction and Setting up New Project with TestNG and Selenium
  • Step 02 - Reading CSS Styles
  • Step 03 - Exercise - Reading CSS Styles
  • Step 04 - Checking if an element is enabled using isEnabled and Exploring WebDriver Interface
  • Step 05 - More methods in WebDriver Interface - getAttribute, getLocation and getSize
  • Step 06 - Accessing Window Information using WebDriver manage window method
  • Step 07 - Window Navigation in Selenium Automation Test with WebDriver navigate method
  • Step 08 - Automation Testing Modal Windows using Sleep
  • Step 09 - Automation Testing Modal Windows with Implicit Wait
  • Step 10 01 - Automation Testing Modal Windows with Explicit Waits
  • Step 10 02 - Automation Testing Modal Windows with Explicit Waits - Events
  • Step 11 - Testing Alert Boxes with Selenium
  • Step 12 - Window Handles and Basics of Testing New Browser Window Launch
  • Step 13 - Finding the Handle of Newly Launched Window
  • Step 14 - Switching to Newly Launched Window
  • Step 15 - Writing Automation Tests for Frames
  • Step 16 - Taking Screenshot during Automation Test
  • Step 17 - Executing JavaScript Code in Selenium Test
  • Step 18 - Reviewing WebDriver Interface
  • Step 20 - Writing Automation Tests for Tables
  • Step 21 - Designing a basic framework for Tables
  • Step 22 - Using Actions Interface for Basic Actions with Keyboard and Mouse
  • Step 23 - More Actions Interface - Drag, Drop, Hold and Release

08 - Introduction to Cross Browser Automation Testing

  • Step 01 - Introduction to Cross Browser Automation Testing
  • Step 02 - Setting up a New Project and Running Tests in Chrome and Firefox
  • Step 03 - Running Automation Tests in Other Browser - Safari, Internet Explorer and Edge
  • Step 04 - Running Headless Automation Test with PhanthomJS
  • Step 05 - Running Automation Tests with Chrome and Firefox Browsers in Headless mode
  • Step 06 - Designing Cross Browser Automation Test Framework - Part 1
  • Step 07 - Designing Cross Browser Automation Test Framework - Part 2

09 - Data Driven Testing with Data Providers, CSV and Excel Spreadsheets

  • Step 01 - Section Overview
  • Step 02 - Understanding Prerequisites and Login Test Scenario
  • Step 03 - Setting up a new Project with Hardcoded Login Scenario
  • Step 04 - Writing Automation Test for Unsuccessful Login
  • Step 05 - Data Driving Unsuccessful Login Automation Test with DataProvider
  • Step 06 - Adding Passwords to DataProvider
  • Step 07 - Adding Expected Test Result to Data Provider
  • Step 08 - Reading Test Data From CSV File
  • Step 09 - Connecting Test Data Provider to CSV File
  • Step 10 - Setting up Excel File with Google Spreadsheets
  • Step 11 - Reading Test Data From Excel using POI and ExcelReadUtil
  • Step 12 - Understanding ExcelReadUtil
  • Step 13 - Connecting Test Data Provider to Excel File

10 - Implementing Page Object Model for Update Todo Scenario

  • Step 01 - Introduction - Objectives and Prerequisites
  • Step 02 - Setting up a New Project and Creating an outline for the Update Todo Test
  • Step 03 - Writing First Version of Update Todo Automation Test
  • Step 04 - First Working Version of Update todo Test and a Discussion on Maintainability
  • Step 05 - Introduction to Page Object Model
  • Step 06 - Creating Your first Page Object
  • Step 07 - Updating the Automation Test to use Login Page Object
  • Step 08 - Creating Action Methods in Login Page Object
  • Step 09 - Creating Todo Page Object
  • Step 10 - Creating List Todo Page Object

11 - Scaling up with Selenium Standalone and Grid

  • Step 01 - Selenium Standalone and Grid - An Introduction
  • Step 02 - Intallation Step I - NPM using Node JS
  • Step 03 - Intallation Steps II and III - Installing and Launching Selenium Standalone Server
  • Step 04 - Setting up an Automation Project and Creating a Simple Test
  • Step 05 - Creating a New Test to run using Selenium Standalone Server
  • Step 06 - Introduction to Selenium Grid - Hub and Nodes
  • Step 07 - Setting up Selenium Grid with a Hub and 2 Nodes
  • Step 08 - Setting up different browser capabilities for the Nodes in the Selenium Grid

12 - Thank You

  • 99 00 Introduction to Automation Testing with Java and Selenium - Congratulations

Templates

Welcome Message


## ADD A FEW SAMPLE REVIEWS AFter a couple of months
## ADD A FEW SAMPLE REVIEWS - in the description of the course 

Congratulations on joining this course from in28Minutes. 

We have 6800+ 5 Star reviews on our courses.  

I hope that by the time you are prompted to leave a review, that you think this course is an amazing course and can write a few sentences about what you like about the course for future students to see. If you do not think this course is a 5-star course, we want to make it a better course for you! Please message me with ways that I can make it the best course for you.

There are three things you need to understand before you start this course!

1...... Listen + See + Do Hands-on + Repeat = 90% Retention
For the first 2 hours, we repeat a few concepts to help you retain them. .

2...... Set Yourself a Goal
Set 1 hour aside every day for the next week for this course! No exceptions allowed :) 

3...... Udemy asks you for a review very early in the course! If you are not ready for giving a review, you can skip giving a review.

Thank you and enjoy the course,
Ranga

Thank You for completing the course message

Congratulations on completing the course from in28Minutes.

We have 6800+ 5 Star reviews on our courses. We hope you think this course is an amazing course and can write a few sentences about what you like about the course for future students to see.

We are on a constant journey to improve our courses further. Do message me if you have any suggestions.

Good Luck for your future.

Ranga from in28Minutes

Bonus Lectures

20+ Courses on Programming, Full Stack Development and Automation Testing. 200+ Youtube Videos on Programming, Design and Architecture.

https://github.com/in28minutes/learn

Exercises

  • TODO

Future Things To Do

  • TODO

About in28Minutes

At in28Minutes, we ask ourselves one question everyday

How do we create more amazing course experiences? We use 80-20 Rule. We discuss 20% things used 80% of time in depth.

We are creating amazing learning experiences for learning Spring Boot with AWS, Azure, GCP, Docker, Kubernetes and Full Stack. 300,000 Learners rely on our expertise. Find out more....

in28MinutesLearningRoadmap-July2019.png

Graphviz

digraph G {
 color="#1BA84A";//green
 color="#D14D28";//orange
 color="#59C8DE";//blue

 node[style=filled,color="#59C8DE"]
 
 subgraph cluster_0 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   Code[label=<Automation Code + Libraries<BR />
   <FONT POINT-SIZE="10">Java, Python etc</FONT>>];
   WebDriver[label=<Web Driver<BR />
   <FONT POINT-SIZE="10">Chrome Driver, Firefox Driver,<BR /> Safari Driver, IE Driver etc</FONT>>];
   Browser[label=<Browser<BR />
       <FONT POINT-SIZE="10">Chrome, Firefox, Safari, IE etc</FONT>>];
   Code -> WebDriver -> Browser;
   label = "Single    System";
 }
   
 RunTests[label=<Run Automation Tests<BR />
       <FONT POINT-SIZE="10">Manually, Continuous Integration etc</FONT>>];
 Application[label=<Web Application<BR />
       <FONT POINT-SIZE="10">Todo Management, Google, Facebook etc</FONT>>];

 RunTests -> Code;
 Browser -> Application;

 RunTests [shape=Mdiamond];
 Application [shape=rectangle];

}

digraph SeleniumStandAlone {
 color="#1BA84A";//green
 color="#D14D28";//orange
 color="#59C8DE";//blue

 node[style=filled,color="#59C8DE"]
 
     subgraph cluster_2 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   WebDriver[label=<Web Driver<BR />
   <FONT POINT-SIZE="10">Chrome Driver, Firefox Driver,<BR /> Safari Driver, IE Driver etc</FONT>>];
   Browser[label=<Browser<BR />
       <FONT POINT-SIZE="10">Chrome, Firefox, Safari, IE etc</FONT>>];
   StandaloneServer[];
   StandaloneServer -> WebDriver -> Browser;
   label = "Stand Alone Server";
 }

 subgraph cluster_0 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   Code[label=<Automation Code + Libraries<BR />
   <FONT POINT-SIZE="10">Java, Python etc</FONT>>];
   Code -> StandaloneServer
   label = "System 1";
 }
   
 subgraph cluster_1 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   Code1[label=<Automation Code + Libraries<BR />
   <FONT POINT-SIZE="10">Java, Python etc</FONT>>];
   Code1 -> StandaloneServer
   label = "System 2";
 }


 Application[label=<Web Application<BR />
       <FONT POINT-SIZE="10">Todo Management, Google, Facebook etc</FONT>>];

 
 Browser -> Application;

 Application [shape=rectangle];

}

digraph SeleniumGrid {
 color="#1BA84A";//green
 color="#D14D28";//orange
 color="#59C8DE";//blue


 node[style=filled,color="#59C8DE"]
 
       subgraph cluster_3 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   WebDriver[label=<Web Driver<BR />
   <FONT POINT-SIZE="10">Chrome Driver, Firefox Driver,<BR /> Safari Driver, IE Driver etc</FONT>>];
   Browser[label=<Browser<BR />
       <FONT POINT-SIZE="10">Chrome, Firefox, Safari, IE etc</FONT>>];
   SeleniumNode1[label="Selenium Node"];
   SeleniumNode1 -> WebDriver -> Browser;
   label = "Selenium Node 1";
 }

     subgraph cluster_4 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   WebDriver2[label=<Web Driver<BR />
   <FONT POINT-SIZE="10">Chrome Driver, Firefox Driver,<BR /> Safari Driver, IE Driver etc</FONT>>];
   Browser2[label=<Browser<BR />
       <FONT POINT-SIZE="10">Chrome, Firefox, Safari, IE etc</FONT>>];
   SeleniumNode2[label="Selenium Node"];
   SeleniumNode2 -> WebDriver2 -> Browser2;
   label = "Selenium Node 2";
 }
 

     subgraph cluster_2 {
   style=filled;
   color="#59C8DE";
   
   node [style=filled,color="#D14D28", fontcolor=white];
   WebDriver[label=<Web Driver<BR />
   <FONT POINT-SIZE="10">Chrome Driver, Firefox Driver,<BR /> Safari Driver, IE Driver etc</FONT>>];
   Browser[label=<Browser<BR />
       <FONT POINT-SIZE="10">Chrome, Firefox, Safari, IE etc</FONT>>];
       
   SeleniumGrid -> SeleniumNode1;
   SeleniumGrid -> SeleniumNode2;
   label = "Selenium Grid";
 }


   
 Application[label=<Web Application<BR />
       <FONT POINT-SIZE="10">Todo Management, Google, Facebook etc</FONT>>];

 AutomationCode[label=<Automation Code + Libraries<BR />
       <FONT POINT-SIZE="10">Java, Python etc, Application 1..n etc, System 1..n etc </FONT>>];
 
 AutomationCode -> SeleniumGrid;
 Browser -> Application;
 Browser2 -> Application;

 Application [shape=rectangle];
 AutomationCode [shape=Mdiamond];
}


Backup

JUnit + Selenium - Google Export from Katalon

package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class GoogleSearchForIn28minutes {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();

  @Before
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://www.katalon.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

  @Test
  public void testGoogleSearchForIn28minutes() throws Exception {
    driver.get("https://www.google.com/");
    driver.findElement(By.id("lst-ib")).click();
    driver.findElement(By.id("lst-ib")).clear();
    driver.findElement(By.id("lst-ib")).sendKeys("in28minutes");
    driver.findElement(By.id("lst-ib")).sendKeys(Keys.ENTER);
  }

  @After
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }

  private boolean isElementPresent(By by) {
    try {
      driver.findElement(by);
      return true;
    } catch (NoSuchElementException e) {
      return false;
    }
  }

  private boolean isAlertPresent() {
    try {
      driver.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
      acceptNextAlert = true;
    }
  }
}

JUnit + Selenium - Facebook Export from Katalon

package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class FacebookLogin {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();

  @Before
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://www.katalon.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

  @Test
  public void testFacebookLogin() throws Exception {
    driver.get("https://www.facebook.com/");
    driver.findElement(By.id("email")).click();
    driver.findElement(By.id("email")).clear();
    driver.findElement(By.id("email")).sendKeys("in28minutes");
    driver.findElement(By.id("pass")).clear();
    driver.findElement(By.id("pass")).sendKeys("dummy");
    driver.findElement(By.id("pass")).sendKeys(Keys.ENTER);
  }

  @After
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }

  private boolean isElementPresent(By by) {
    try {
      driver.findElement(by);
      return true;
    } catch (NoSuchElementException e) {
      return false;
    }
  }

  private boolean isAlertPresent() {
    try {
      driver.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
      acceptNextAlert = true;
    }
  }
}

TestNg + Selenium - Google Export from Katalon

package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class GoogleSearchForIn28minutes {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();

  @BeforeClass(alwaysRun = true)
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://www.katalon.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

  @Test
  public void testGoogleSearchForIn28minutes() throws Exception {
    driver.get("https://www.google.com/");
    driver.findElement(By.id("lst-ib")).click();
    driver.findElement(By.id("lst-ib")).clear();
    driver.findElement(By.id("lst-ib")).sendKeys("in28minutes");
    driver.findElement(By.id("lst-ib")).sendKeys(Keys.ENTER);
  }

  @AfterClass(alwaysRun = true)
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }

  private boolean isElementPresent(By by) {
    try {
      driver.findElement(by);
      return true;
    } catch (NoSuchElementException e) {
      return false;
    }
  }

  private boolean isAlertPresent() {
    try {
      driver.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
      acceptNextAlert = true;
    }
  }
}

TestNg + Selenium - Facebook Export from Katalon

package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class FacebookLogin {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();

  @BeforeClass(alwaysRun = true)
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://www.katalon.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

  @Test
  public void testFacebookLogin() throws Exception {
    driver.get("https://www.facebook.com/");
    driver.findElement(By.id("email")).click();
    driver.findElement(By.id("email")).clear();
    driver.findElement(By.id("email")).sendKeys("in28minutes");
    driver.findElement(By.id("pass")).clear();
    driver.findElement(By.id("pass")).sendKeys("dummy");
    driver.findElement(By.id("pass")).sendKeys(Keys.ENTER);
  }

  @AfterClass(alwaysRun = true)
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }

  private boolean isElementPresent(By by) {
    try {
      driver.findElement(by);
      return true;
    } catch (NoSuchElementException e) {
      return false;
    }
  }

  private boolean isAlertPresent() {
    try {
      driver.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
      acceptNextAlert = true;
    }
  }
}

Todo For Future

  • Test Retry

Should You Automate?

  • Is Your Flow Changing?
  • Is Your UI Stable?
  • Do you have tight deadlines?
    • Building Good Automation Tests Needs Time

Selenium History

  • 2004 - Jason Huggins at Thoughtworks created initial version of Selenium Core called Selenium RC (Selenium 1) - a very complicated Javascript framework, running in the Browser. However, since JavaScript is not considered secure - it had limitations.
  • 2006 - Simon Stewart at Google started with the idea of Web Driver
  • 2008 - Decision to merge Selenium and Web Driver. It will be called Selenium 2.x.

Selenium History - 2

Todo to Improve Course

  • Ctrl + Click to Open a Class
  • sysout template expansion
  • Rerecord
    • Step 01 - Why should you learn HTML and CSS.mp4
    • Step 02 - How does Web Work - Request, Response, HTML and Browser.mp4

Text search with contains

WebElement notifications = driver.findElement(By.xpath("//*[contains(text(),'" + textToSearchFor + "')]"));
System.out.println("NOTIFICATIONS : " + notifications.getText());

Advanced CSS Selectors

attributeSuffix - driver.findElement(By.cssSelector("input[name$='word']"));
sibling - driver.findElement(By.cssSelector("input[name='password'] + input[type='submit']"));
directDescendant - driver.findElement(By.cssSelector("div > input[name='email']"));
anyDescendant() - driver.findElement(By.cssSelector("form input[name='email']"));
        attributePrefix - driver.findElement(By.cssSelector("input[name^='pass']"));

Advanced XPAth Selectors

CLASS - //*[contains(concat(' ',normalize-space(@class),' '),' btn ')]
driver.findElement(By.xpath("//div[contains(.,'A visible paragraph')]/form"));
driver.findElement(By.xpath("//*[contains(text(),'A paragraph XXX with this text in bold')]"));
driver.findElement(By.xpath("//*[contains(normalize-space(.),'A paragraph with this text in bold')]"));

File Upload

  @Test
  public void testFileUpload() throws IOException {

    ChromeDriverManager.getInstance().setup();

    WebDriver driver = new ChromeDriver();

    Path fileToUpload = Files.createTempFile(Paths.get("."), "some-file-to-upload", ".txt");

    driver.get("http://localhost:8080/pages/file-upload.html");

    driver.findElement(By.name("file")).sendKeys(fileToUpload.toFile().getCanonicalPath());

    driver.findElement(By.cssSelector("input[type='submit']")).click();

    String message = driver.findElement(By.id("welcome-message")).getText();
    System.out.println(message);
    
    Files.delete(fileToUpload);
    driver.close();

    driver.quit();

  }

Advanced Selenium Listeners

/src/test/java/com/in28minutes/automation/webapp/basics/WebDriverEventListenerUsingImplements.java

public class WebDriverEventListenerUsingImplements implements WebDriverEventListener{

  @Override
  public void afterClickOn(WebElement element, WebDriver driver) {
    System.out.printf("Element with tag %s and name %s is clicked \n",  element.getTagName(), element.getAttribute("name"));
    
  }

  //Other empty methods are deleted for saving space!!

}

Unit Test

  @Test
  public void setFormElementsWithListeners() {

    ChromeDriverManager.getInstance().setup();

    WebDriver driver = new ChromeDriver();

    EventFiringWebDriver eventFiringDriver = new EventFiringWebDriver(driver);

    WebDriverEventListenerUsingImplements eventListener = new WebDriverEventListenerUsingImplements();

    eventFiringDriver.register(eventListener);

    eventFiringDriver.get("http://localhost:8080/pages/forms.html");

    driver.findElement(By.id("textElement")).sendKeys("new-textElement-value");
    driver.findElement(By.id("textAreaElement")).sendKeys("new-textAreaElement-value");

    eventFiringDriver.findElement(By.id("checkboxElement1")).click();
    eventFiringDriver.findElement(By.id("checkboxElement2")).click();

    driver.findElement(By.id("inlineCheckboxElement1")).click();
    driver.findElement(By.id("inlineCheckboxElement2")).click();

    List<WebElement> optionRadios = driver.findElements(By.name("optionsRadios"));

    optionRadios.get(1).click();

    List<WebElement> optionsRadiosInline = driver.findElements(By.name("optionsRadiosInline"));

    optionsRadiosInline.get(1).click();

    Select selectElement = new Select(driver.findElement(By.id("selectElement1")));// 1

    selectElement.selectByValue("4");

    Select multiSelectElement = new Select(driver.findElement(By.id("multiSelectElement")));// 1,3

    multiSelectElement.selectByValue("5");

    driver.close();
    driver.quit();
  }

/src/test/java/com/in28minutes/automation/webapp/basics/WebDriverEventListenerUsingExtends.java

package com.in28minutes.automation.webapp.basics;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.events.AbstractWebDriverEventListener;

public class WebDriverEventListenerUsingExtends extends AbstractWebDriverEventListener{
  
  @Override
  public void beforeNavigateTo(String url, WebDriver driver) {
      System.out.printf("We are at %s and we are navigating to %s \n",  driver.getCurrentUrl(), url);
  }

  @Override
  public void afterNavigateTo(String url, WebDriver driver) {
    System.out.printf("We are at %s and we have navigated to %s \n",  driver.getCurrentUrl(), url);
  }

  @Override
  public void beforeNavigateBack(WebDriver driver) {
    System.out.printf("We are at %s and we want to navigate back \n",  driver.getCurrentUrl());
  }

  @Override
  public void afterNavigateBack(WebDriver driver) {
    System.out.printf("We are at %s and we completed the navigate back \n",  driver.getCurrentUrl());
  }

  @Override
  public void afterClickOn(WebElement element, WebDriver driver) {
    System.out.printf("Element with tag %s and name %s is clicked \n",  element.getTagName(), element.getAttribute("name"));
  }

}

Test NG Advanced Features

//@Test(groups={"group-4"})
public class PlayingWithTestNGTest {

  @Test(groups = { "group1" })
  //Groups can be Unit Test, Integration Test, Performance etc
  public void group1Test() {
    System.out.println("Group 1 Test");
  }

  @Test(groups = { "group2" })
  //Groups can be Unit Test, Integration Test etc
  public void group2Test() {
    System.out.println("Group 2 Test");
  }

  @AfterGroups(groups = { "group1" })
  public void afterGroup1() {
    System.out.println("After Group1");
  }

  @BeforeGroups(groups = { "group2" })
  public void beforeGroup2() {
    System.out.println("Before Group2");
  }

  @Test(timeOut = 1000)
  public void timeoutTest() {

  }

  @Test(expectedExceptions = { Exception.class })
  public void expectAnException() {
    throw new RuntimeException("flkasdjf");
  }

  @Test(enabled = false)
  public void ignoredTest() {

  }

  @Test
  @Parameters({ "browser" })
  public void browserSpecificTest(@Optional("firefox") String browser) {
    System.out.println(browser);
  }

  @Test(dependsOnMethods="setupSomething")
  //dependsOnGroups
  public void thisTestNeedsSomethingSetup() {
    System.out.println("I need something else");
  }
  
  @Test
  public void setupSomething() {
    System.out.println("Setup Something");    
  }

/src/test/java/com/in28minutes/automation/TestNgResultListener.java

package com.in28minutes.automation;

import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;

public class TestNgResultListener implements ITestListener{

  public void onFinish(ITestContext arg0) {
    // TODO Auto-generated method stub
    
  }

  public void onStart(ITestContext arg0) {
    // TODO Auto-generated method stub
    
  }

  public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {
    // TODO Auto-generated method stub
    
  }

  public void onTestFailure(ITestResult arg0) {
    System.out.println("Test Failed");
    
  }

  public void onTestSkipped(ITestResult arg0) {
    // TODO Auto-generated method stub
    
  }

  public void onTestStart(ITestResult arg0) {
    // TODO Auto-generated method stub
    
  }

  public void onTestSuccess(ITestResult arg0) {
    System.out.println("Test Succeded");
    
  }

}

/src/test/java/com/in28minutes/automation/TestNgTestReporter.java

package com.in28minutes.automation;

import java.util.List;
import java.util.Map;

import org.testng.IReporter;
import org.testng.ISuite;
import org.testng.ISuiteResult;
import org.testng.ITestContext;
import org.testng.xml.XmlSuite;

public class TestNgTestReporter implements IReporter {

  public void generateReport(List<XmlSuite> xmlSuite, List<ISuite> iSuite, String outputDirectory) {
    for(ISuite suite: iSuite) {
      Map<String, ISuiteResult> results = suite.getResults();
      for(ISuiteResult result:results.values()) {
        ITestContext testContext = result.getTestContext();
        System.out.println(testContext.getPassedTests());
      }
    }
    
  }

}

More Repositories

1

devops-master-class

Devops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops
Java
2,203
star
2

spring-microservices

Microservices using Spring Boot, Spring Cloud, Docker and Kubernetes
Java
1,770
star
3

java-tutorial-for-beginners

Java Tutorial For Beginners with 500 Code Examples
1,312
star
4

java-best-practices

Best practices in Coding, Designing and Architecting Java Applications
1,254
star
5

master-spring-and-spring-boot

Spring and Spring Boot Tutorial For Absolute Beginners - 10-in-1 - Spring to Spring Boot to REST API to Full Stack to Containers to Cloud
Java
1,226
star
6

spring-boot-examples

Code Examples for everything thats written on www.springboottutorial.com
Java
1,207
star
7

spring-master-class

An updated introduction to the Spring Framework 5. Become an Expert understanding the core features of Spring In Depth. You would write Unit Tests, AOP, JDBC and JPA code during the course. Includes introductions to Spring Boot, JPA, Eclipse, Maven, JUnit and Mockito.
Java
1,142
star
8

java-a-course-for-beginners

Java Programming Tutorial for Beginners
JavaScript
1,044
star
9

JavaInterviewQuestionsAndAnswers

Java Interview Questions and Answers
Java
973
star
10

spring-boot-master-class

Understand and love the power of Spring Boot - All its features are illustrated developing a web application managing todos and a basic API for survey questionnaire. Also covers unit testing, mocking and integration testing.
Java
965
star
11

course-material

Course Material for in28minutes courses on Java, Spring Boot, DevOps, AWS, Google Cloud, and Azure.
947
star
12

SpringMvcStepByStep

Spring MVC Tutorial for beginners - In 25 Small Steps
Java
828
star
13

spring-microservices-v2

Microservices + Spring Boot 2 + Spring Cloud + Docker + Kubernetes - https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloud/. Latest Repo - http://github.com/in28minutes/spring-microservices-v3
JavaScript
714
star
14

learn

How do you achieve your career objectives? Complete career paths with amazing Cloud, Full Stack and Microservice Courses and Videos from in28Minutes
685
star
15

SpringIn28Minutes

Spring Tutorial For Beginners
Java
657
star
16

spring-interview-guide

200+ Questions and Answers on Spring, Spring Boot and Spring MVC
JavaScript
642
star
17

MockitoTutorialForBeginners

Mockito Tutorial for Beginners
Java
632
star
18

jpa-with-hibernate

Master JPA using Hibernate as the implementation. Learn the basics of JPA - entities, relationships, entity manager, annotations, JPQL and Criteria API. Take a step into the advanced world of JPA - caching, performance tuning(n + 1 queries), mapping inheritance hierarchies. Get a peek into the magic of Spring Data JPA & Spring Data Rest.
Java
630
star
19

SpringBootForBeginners

Spring Boot Tutorial For Beginners
Java
609
star
20

full-stack-with-react-and-spring-boot

Your First Full Stack Application with React and Spring Boot
Java
606
star
21

full-stack-with-angular-and-spring-boot

Your First Full Stack Application with Angular and Spring Boot
Java
605
star
22

in28minutes-initiatives

All initiatives to build a connect between industry, instructors and learners
596
star
23

java-cheat-sheet

Java Tutorial For Beginners - Companion Reference
588
star
24

JavaWebApplicationStepByStep

JSP Servlets Tutorial For Beginners - in 25 Steps
Java
534
star
25

spring-web-services

Spring Web Services - SOAP and RESTful
Java
532
star
26

spring-unit-testing-with-junit-and-mockito

Spring Unit Testing with JUnit and Mockito
Java
359
star
27

docker-crash-course

Docker for beginners - with Java and Spring Boot Applications and Microservices
Java
350
star
28

functional-programming-with-java

Learn Functional Programming with Java using a Hands-on Step by Step Approach
Java
340
star
29

kubernetes-crash-course

Learn Kubernetes and Docker with Google Kubernetes Engine deploying Spring Boot Microservices
Java
327
star
30

interview-guide

Java interview guide - 200+ Question and Answers
297
star
31

deploy-spring-microservices-to-aws-ecs-fargate

Take your first steps towards cloud with AWS ECS Fargate. Deploy REST APIs and Microservices with Spring Boot and Docker Containers to the cloud.
Java
265
star
32

SpringBootWebApplicationStepByStep

Develop your first web application with Spring Boot Magic
Java
256
star
33

spring-boot-react-fullstack-examples

All full stack examples with Spring Boot and React for articles on our website http://www.springboottutorial.com
JavaScript
255
star
34

roadmaps

Roadmaps of in28minutes courses!
245
star
35

spring-microservices-v3

JavaScript
228
star
36

JUnitIn28Minutes

JUNIT Tutorial For Beginners
Java
216
star
37

MavenIn28Minutes

Maven Tutorial for Beginners with Examples
Java
193
star
38

python-tutorial-for-beginners

Python Tutorial for Beginners with 500 Code Examples
182
star
39

in28minutes.github.io

Spring Boot Tutorials
HTML
171
star
40

deploy-spring-boot-aws-eb

Deploying Spring Boot Apps to AWS using Elastic Beanstalk
Java
160
star
41

getting-started-in-5-steps

How to install and get started with Java, Eclipse, Maven, JUnit, Mockito & Spring in 5 easy steps
JavaScript
154
star
42

clean-code

Learn to Write Clean Code with Java. Get Hands-on with 20+ Code Examples involving 4 principles of Simple Design, Refactoring and TDD.
JavaScript
153
star
43

first-steps-to-software-architect

How to start your journey towards software architecture?
136
star
44

MockitoIn28Minutes

Learn Mockito from In28Minutes
Java
121
star
45

learning-paths-cloud-and-devops

How to learn Cloud and DevOps
119
star
46

spring-boot-angular-fullstack-examples

All full stack examples with Spring Boot and Angular for articles on our website http://www.springboottutorial.com
TypeScript
109
star
47

in28Minutes-Course-Roadmap

A Roadmap for our Courses. Remember we focus on Java, Microservices, Web Applications and are big Spring Shop - Spring, Spring MVC, Spring Boot, Spring Cloud...
104
star
48

docker

Docker for Beginners - Learn Docker in 5 Steps
Java
101
star
49

pcf-crash-course-with-spring-boot

PCF Crash Course for Java, Spring and Spring Boot Developers - Deploy Spring Boot REST API, Full Stack Applications and Microservices to Pivotal Cloud Foundry (PCF)
Java
98
star
50

azure-devops-kubernetes-terraform-pipeline

https://github.com/in28minutes/devops-master-class
Java
87
star
51

deploy-spring-boot-to-azure

Deploy Spring Boot Applications to Azure Web Apps
Java
82
star
52

camel

Learn Enterprise Integration Patterns with Apache Camel
JavaScript
80
star
53

Design-Patterns-For-Beginners

Design Patterns for Beginners
80
star
54

JavaObjectOrientedProgramming

Learn basics of object oriented programming with Java
Java
69
star
55

learn-programming-with-python-

learn-programming-with-python​
Python
67
star
56

10-Steps-to-High-Quality-Java-Developer

You Key to Becoming a High Quality Java Developer
61
star
57

java-to-python-in-100-steps

Learn Python using your Java Knowledge
Python
58
star
58

java-technology-for-beginners

In my 15 years of designing and developing more than 100 java web applications, there are a number of terminologies, standards, frameworks, tools that I have used. I know how difficult it is for a beginner to understand them. And imagine the trouble non techies face - the business, testing teams and others. So, this guide is to demystify these terms! Enough talk. Let's Rock and Roll......
58
star
59

spring-boot-vuejs-fullstack-examples

All full stack examples with Spring Boot and Vue JS for articles on our website http://www.springboottutorial.com
Java
57
star
60

EclipseIn28Minutes

Eclipse Tutorial for Beginners - From in28Minutes
53
star
61

jenkin-devops-microservice

https://github.com/in28minutes/devops-master-class
Java
49
star
62

spring-complete-career-path

Level 1 covers Basics of Spring Developing a web application with Spring MVC Basics of Spring Boot - Autoconfiguration, Starter Projects Basic Todo Management Application with Login/Logout Model, Controllers, ViewResolver and Filters Forms - DataBinding, Validation Bootstrap to style the page Spring Security Exception Handling Level 2 (coming soon) will cover Rest APIs with Spring Boot SOAP Web Services with Spring Boot. Level 3 (coming soon) will cover Spring Cloud Microservices
Java
44
star
63

go-serverless

Go Serverless with AWS Lambda and Azure Functions - Udemy Course https://www.udemy.com/course/serverless-tutorial-aws-lambda-and-azure-functions
JavaScript
41
star
64

Tips-Database

Tips about Web Services, APIs, Microservices, Spring, Spring Boot, Maven, Eclipse etc
37
star
65

TDDin28Minutes

TDD Tutorial For Beginners - from in28Minutes
Java
31
star
66

spring-boot-to-cloud

Spring Boot to Cloud (AWS, Azure, GCP and PCF) with Docker and Kubernetes
Java
30
star
67

JavaTutorialForBeginners

Java Tutorial for Beginners with examples
Java
29
star
68

BasicWebServletsIn28Minutes

Java
28
star
69

campus-interview-guide

60 Day Learning Challenges for Campus Interviews
28
star
70

CTutorialForBeginners

C Tutorial for Beginners
27
star
71

Java-EE-Design-Patterns

26
star
72

HibernateJPAStepByStep

Hibernate Tutorial For Beginners - Step by Step with Examples
22
star
73

in28minutes.com

Awesome Courses from the Best Selling Instructor
HTML
22
star
74

RealWorldWebApplicationWithServletsAndJspIn28Minutes

Learn to Develop your first web application with Servlets and JSP
Java
20
star
75

cloud.in28minutes.com

cloud.in28minutes.com
HTML
20
star
76

jenkins-pipeline

Java
18
star
77

spring-boot-rest-api-playground

Java
18
star
78

spring-microservices-v3-old

JavaScript
16
star
79

microservice-reference-archetype

Java
14
star
80

hello-world-rest-api-aws-ecs-codepipeline

Java
14
star
81

Struts2StepByStep

Learn Struts 2 Step By Step
Java
11
star
82

jshell-for-java-programmers

An introduction to JShell for Java Programmers
11
star
83

hello-world-rest-api-azure-pipelines

Java
10
star
84

in28minutes

9
star
85

getting-started-for-beginners-v2

Updated Getting Started Guides for Beginners Recorded with Spring Boot 3 - Spring, Spring Boot, JUnit, Mockito, JPA, Hibernate ....
Java
9
star
86

spring-boot-todo-rest-api-h2-aws-codepipeline

Java
8
star
87

In28MinutesTemplate

Serves as template for my new courses
8
star
88

todo-app

Java
6
star
89

automatewithselenium.com

Learn how to automate your tests with Selenium - Java, Python, C# and JavaScript - automatewithselenium.com
CSS
6
star
90

dev-config-server-test

4
star
91

config-server

2
star
92

programmingabc.com

Master Content for our Programming Website - programmingabc.com
CSS
2
star
93

Future-Course-Preparation

1
star
94

hello-world-playground

Java
1
star