28
JAVA, JMETER,TESTING FRAMEWORKS & SELENIUM/WEBDRIVER For SDET ABSTRACT This course allows a person to move from QA Manual to automation skillset. Prepares to get started with core-skill set required for SDET position, concentration given on Java, Selenium/WebDriver, JUnit, TestNG, Cucumber test runners along with Maven. Mock Objects, JMeter and Appium are introduced through this course to get prepared for SDET – Level II course. Kavin School SDET Preparation Course Level I Software Development Engineer Test Preparation Course Level - I

Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

  • Upload
    others

  • View
    36

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

JAVA, JMETER,TESTING

FRAMEWORKS &

SELENIUM/WEBDRIVER

For SDET

ABSTRACT This course allows a person to move from QA Manual to automation skillset. Prepares to get started with core-skill set required for SDET position, concentration given on Java, Selenium/WebDriver, JUnit, TestNG, Cucumber test runners along with Maven. Mock Objects, JMeter and Appium are introduced through this course to get prepared for SDET – Level II course.

Kavin School SDET Preparation Course Level I

Software Development

Engineer Test Preparation

Course Level - I

Page 2: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 1 of 27

Java, Web Driver/Web Services, Appium JMeter, Mock Objects and Test Runners

Table of Contents Day 1 AM: - Introduction to Java Language (4 hours) ............................................................................... 4

Java Basics .............................................................................................................................................. 4

Core Java Basic Concepts ................................................................................................................... 4

Core Java Control Flow Statements ....................................................................................................... 4

Control Flow:...................................................................................................................................... 4

Java Annotations .................................................................................................................................... 5

Intellij IDE Features: ............................................................................................................................... 5

Loops & Debugging in Java .................................................................................................................... 5

Presentations: ........................................................................................................................................ 6

Day 1 PM: - JUnit & Web Driver Introduction (4 hours) ............................................................................ 7

Installations ............................................................................................................................................ 7

JUnit Basic Concepts .............................................................................................................................. 7

JUnit WebDriver Test Case - ZenPhoto App Project .............................................................................. 7

Day 2 AM: - Basics of Java OOPS Concepts (4 hours) ................................................................................ 8

Java Basics OOP Concepts...................................................................................................................... 8

Shape Java Project ................................................................................................................................. 8

Day 2 PM: - JUnit Advanced Concepts & Web Driver Locator Strategy (4 hours)................................... 10

Page 3: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 2 of 27

Finding locators in different browsers............................................................................................. 10

Testing Strategies and Best Practices .............................................................................................. 10

What is in Selenium 2.0 & new in 3.0 .............................................................................................. 10

JUnit DataPoints and Theories............................................................................................................. 10

Junit Parameterized Parameters ......................................................................................................... 11

JUnit Test Suites ................................................................................................................................... 11

Day 3 AM: - OOPS Concepts with Shape Project (4 hours) ..................................................................... 12

Java Basics OOP Concepts.................................................................................................................... 12

Shape Java Project ............................................................................................................................... 12

Java Annotations .................................................................................................................................. 12

Javadoc................................................................................................................................................. 12

Presentations: ...................................................................................................................................... 13

Day 3 PM: - WebDriver Concepts using Amalgam Project (4 hours) ...................................................... 14

WebDriver Concepts ............................................................................................................................ 14

WebDriver waits .................................................................................................................................. 14

Amalgam Project (exercise) ................................................................................................................. 14

WebDriver TestCase - Macys EnergyEfficient Test Case (exercise) ..................................................... 15

WebDriver TestCase - VisitWebSite (exercise) .................................................................................... 15

WebDriver TestCase - ClickAlert (exercise) ......................................................................................... 15

WebDriver TestCase - CheckPopups (exercise) ................................................................................... 15

WebDriver TestCase - CheckFrames (exercise) ................................................................................... 16

Presentations ....................................................................................................................................... 16

Day 4 AM & PM: - Data Driven Testing using JUnit (8 hours) ................................................................. 17

Overview of Data Driven Testing Concepts ......................................................................................... 17

Maven Concepts .................................................................................................................................. 17

Understanding CustomFormat core Java API's for data driven testing (exercise) .............................. 18

Understanding ReadProperty core Java API's for data driven testing (exercise) ................................ 18

Understanding ReadText core Java API's for data driven testing (exercise) ....................................... 18

Understanding ReadCSV core Java API's for data driven testing (exercise) ........................................ 18

Understanding ReadExcel core Java API's for data driven testing (exercise) ...................................... 18

Understanding ReadDB core Java API's for data driven testing (exercise) ......................................... 19

ZenPhoto TestCase (exercise) .............................................................................................................. 19

Presentations ....................................................................................................................................... 19

Page 4: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 3 of 27

Day 5 AM & PM : - Cucumber Concepts with Page Object Model (8 hours) .......................................... 20

BDD Concepts ...................................................................................................................................... 20

Gherkin................................................................................................................................................. 20

Installations .......................................................................................................................................... 20

Cucumber Basic Concepts using Java .................................................................................................. 20

Exploring Cucumber Concepts: ............................................................................................................ 21

Day 6 AM & PM: - REST WebServices Concepts & Web Services Testing using UniRest & RestAssured Frameworks (8 hours) .............................................................................................................................. 22

REST ..................................................................................................................................................... 22

API Testing ........................................................................................................................................... 22

REST consuming using Curl .................................................................................................................. 22

REST testing using Postman ................................................................................................................. 22

REST testing using Swagger ................................................................................................................. 23

REST Automated Testing in Java .......................................................................................................... 23

Day 7 AM & PM: - Mock & JMeter (8 hours) ........................................................................................... 24

Mocking ( 3 hours) ............................................................................................................................... 24

Performance Testing with JMeter (5 hours) ........................................................................................ 24

Day 8 AM & PM – Appium & TestNG Concepts (8 hours) ....................................................................... 25

TestNG Concepts ( 3 hours) ................................................................................................................. 25

TestNG Asserts ..................................................................................................................................... 25

TestNG Parameters .............................................................................................................................. 25

TestNG Data Providers ......................................................................................................................... 26

Running TestNg Suites ......................................................................................................................... 26

Appium Concepts (5 hours) ................................................................................................................. 26

Hours for each session: ............................................................................................................................ 26

Course Outline: ........................................................................................................................................ 27

Page 5: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 4 of 27

Day 1 AM: - Introduction to Java Language (4 hours) The session focuses on introducing core Java to the students. Java Core Concepts covers the buzzwords of Java, different versions of Java, Byte Code, Data Types, Literals, Operators, introduces variables and escape codes; The example programs start with HelloJava Program and moves forward with Operators and Variables.

Java Basics

Core Java Basic Concepts 1. Java Buzzwords 2. Key Java Packages 3. Java Versions 4. Java Byte Code 5. Java Platform 6. Hello Java Program 7. Hello Java 8. Compile and Run HelloJava 9. Variables 10. Primitive Data Typess 11. Literals 12. Creating Literals Java Example Program 13. Compile and Run Literals Java 14. Escape Codes 15. Operators 16. Creating Operators Example 17. Compile and Run Operators Example 18. Types of Operators

✓ Logical Operators ✓ Bitwise Operators ✓ Increment/Decrement Operators ✓ Bitshift Operators ✓ Assignment Operators ✓ Other Operators

Core Java Control Flow Statements

Control Flow: 1. if-else 2. if statement different syntaxes 3. if statement examples 4. compile and run if statement example 5. switch flow

Page 6: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 5 of 27

6. switch syntax 7. switch statement examples 8. compile and run switch statement example 9. DietSchedule Java Program 10. compile and run DietSchedule Java Program

Java Annotations

• What are annotations in Java?

• Built in annotations

Intellij IDE Features:

• What is IntelliJ IDE – Different editions

• Building Projects

• Code Analysis

• Code Completion

• Debugging Applications

• Editing - working with Code

• Integrating Maven

• Navigating Projects

• Project Structure and Configuration

• Refactoring

• Testing

• Using Version Control (git/SVN)

Loops & Debugging in Java

• While Loop Flow

• While Loop Syntax

• IntelliJ IDE Core Java Project

• Create Java Project

• Open Associated Perspective

• Create Package com.kavinschool.corejava.example

• Create Class While

• Create code for While Example

• Run the code in IntelliJ IDE

• do-while Flow

• do-while Syntax

• Create Class DoWhile

• Create code for DoWhile Example

• Run the code in IntelliJ IDE

• Modify DoWhile Example

Page 7: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 6 of 27

• Debug DoWhile Example

• for Flow

• for Syntax

• Create Class AsciiChart

• Create code for AsciiChart Example

• Run the code in IntelliJ IDE

• Modify AsciiChart Example

• Debug AsciiChart Example

• IntelliJ IDE Exercises

• Several questions students to find answers

Presentations: • Core Java Basic Concepts

• Control Flow Statements in Java

• IntelliJ IDE Features

• Loops in Java

• Core Java Exercises

Page 8: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 7 of 27

Day 1 PM: - JUnit & Web Driver Introduction (4 hours) This session provides detailed JUnit Concepts.

Installations

• Installing WebDriver Server Tools ✓ GoogleChromeDriver ✓ Firefox Gekho Driver ✓ InternetExplorer Driver

Introduces JUnit Concepts like

JUnit Basic Concepts • org.junit

• org.hamcrest

• JUnit Annotations

• Order of Execution of Before Class, AfterClass, Before, and After

• Asserts ✓ AssertEquals, AssertTrue, AssertNull, AssertNotNull, etc

JUnit WebDriver Test Case - ZenPhoto App Project

• Creating Zen Photo Test Case to Web Driver Java

• Creating Intellij IDE Zen Photo Login Project

• Running Zen Photo Login using WebDriver

• Using DataPoints and Theories using WebDriver

• Using Parameterized parameters in WebDriver

Page 9: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 8 of 27

Day 2 AM: - Basics of Java OOPS Concepts (4 hours) This session provides Object Oriented Programming Concepts in Java.

Java Basics OOP Concepts

• OOP Concepts

• Abstraction (Objects)

• Encapsulation (Classes)

• Communication (Methods)

• Lifetime (Object)

• Hierarchies (Class)

• Polymorphism (Classes)

• What is a Class?

• Class Syntax

• What is an abstract class?

• Example for abstract class

• Java Objects and Instances

• What is an abstraction?

• Encapsulation in Java

• Modifiers in Java

• Access controls in Java

• Inheritance

• Single Inheritance

• Class Hierarchy

• Animal World Top Level Hierarchy

• Animal World 5 Levels Hierarchy

• Shape Hierarchy

• What is a constructor method?

• Example for constructors

• Class Hierarchy

• this keyword

• this keyword usages and examples

• Overloaded Methods

• Overloading Methods examples

• Overriding Methods

• Overriding Methods example

Shape Java Project

• Create ShapeWorkSpace

• Goto workbench

• Create Shape Project

Page 10: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 9 of 27

• Abstract Shape Class UML diagram

• Create Abstract Classes ✓ Shape ✓ UML diagram of Shape Hierarchy ✓ Shape 2D ✓ UML Class diagram of Shape2D ✓ Shape 3D ✓ UML Class diagram of Shape3D ✓ Shape 2D extends Shape ✓ Shape 3D extends Shape

• Create DemoShape

• Shape 2D formula for Square, Rectangle and Circle

• Shape 2D common properties for Square, Rectangle and Circle

• Shape 2D concrete implementation hierarchy

• Create 2D Concrete Classes ✓ Square ✓ UML Class diagram of Square ✓ Modify DemoShape and use Square Class ✓ Rectangle ✓ Circle

• Shape 3D formula for Cone, Cube and Cuboid

• Shape 3D identify common properties for Cone, Cube and Cuboid

• Shape 3D concrete implmentation hierarchy

• Create 3D Concrete Classes ✓ Cone ✓ UML Class diagram of Cone ✓ Modify DemoShape and use Cone Class ✓ Cube ✓ Cuboid

Page 11: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 10 of 27

Day 2 PM: - JUnit Advanced Concepts & Web Driver Locator Strategy (4 hours)

Finding locators in different browsers

• Finding locators in Firefox (FF)

• Using Firebug with FirePath and Firefinder

✓ Usage of Firebug with a live example ✓ Finding locators with different tools ✓ Using FirePath and FireFinder ✓ Finding XPath, CSS Path, Link, ID, Name using Firebug

• Finding locators in GC

• Using XPath Viewer Chrome Extensions

• Finding locators in IE

• Using Fire-IE-Selenium

Testing Strategies and Best Practices

• What to automate?

• How to test your application?

• How should you test your applications?

• Implementing Best Practices while creating test cases

• Exploring Toolbox

✓ HTML Validator ✓ Link Checker ✓ YSlow

What is in Selenium 2.0 & new in 3.0 • New Features in WebDriver

JUnit DataPoints and Theories • Internal Data using DataPoints

• @RunWith

• org.junit.runner

• @DataPoints

• @Theory

• Theory.class

• ZenPhotoLogin with DataPoints

• Running ZenPhotoLogin in Intellij IDE

• @Test Annotation

Page 12: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 11 of 27

Junit Parameterized Parameters • Internal Data using Parameters

• Parameterized Annotation

• org.junit.runners

• @Parameterized.parameters

• Parameterized.class

• Collection and Constructors

• Parameterized ZenPhotoLogin Test

• Running ZenPhotoLogin Test in Intellij IDE

JUnit Test Suites • Creating JUnit Test Suites in Intellij IDE

• Running Test Suites using Intellij IDE

Page 13: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 12 of 27

Day 3 AM: - OOPS Concepts with Shape Project (4 hours)

Java Basics OOP Concepts • Finalizer Methods

• Finalizer Demo example

• Using finalise() method

• Interfaces

• Vehicle Interfaces Example

• Shapes Interfaces Example

Shape Java Project • Interfaces for Shape Project

• UML diagram with Interfaces

• Create Interfaces ✓ ShapeLabel ✓ ShapeColor

• Create Interfaces Hierarchy ✓ BaseColors ✓ RainbowColors ✓ RainbowColors extends BaseColors ✓ ShapeRainbowColor ✓ ShapeRainbowColor extends RainbowColors, ShapeColor

• Implementing Interfaces ✓ CirclePlus ✓ CirclePlus extends Circle implements ShapeColor, ShapeLabel ✓ RectanglePlus ✓ RectanglePlus extends Rectangle implements ShapeLabel, ShapeRainbowColor

• Exceptions in Java ✓ ColorRangeException ✓ CirclePlus to throw new ColorRangeException

Java Annotations

• Creating custom annotations

• Creating About @interface

• Creating SquareAbout and using the @About annotation

• Creating PrintClassDetails and seeing the @About annotation values

Javadoc

• Comments in Java

• Javadoc comments

Page 14: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 13 of 27

• Javadoc Tags in Java

• Javadoc command line options

• Documenting Shape Project

• Javadoc annotations

• @author and @see usage

• @depricated with @Depricated annotation

• @return usage

• @parm usage

• package-info.java usage

• package-info.java usage

• @version and @since usage

• @serial usage

• Context sensitive Javadoc

Presentations:

• OOP Concepts in Java

• Shape Hierarchy Project

• Java Annotations

• JavaDoc Concepts

• Generating Javadoc in IntelliJ IDE

• Shape Hierarchy Javadoc

• Shape Hierarchy UML Javadoc

Page 15: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 14 of 27

Day 3 PM: - WebDriver Concepts using Amalgam Project (4 hours)

This session concentrates on WebDriver Concepts

WebDriver Concepts

• WebDriver W3C Specification

• What is WebDriver?

• What is Selenium 2.0?

• Browsers supported by WebDriver

• Mobile supported by WebDriver

• Is WebDriver backward compatible?

• Locators in WebDriver

• findElement vs findElements

• By by mechanism to locate webelements

• isTextPresent - assertTextPresent support

• can I take screenshot?

• How do I handle waits?

• Creating and Running SquareSimpleTest

• testng_square_simple.xml - creating and running using testng control file

• understanding the results

WebDriver waits

• How do I handle waits?

• ImplicitlyWait

• ExplicitWaits

• WebDriverWait ✓ ExpectedConditions ✓ FluentWait ✓ Thread.sleep()

Amalgam Project (exercise)

• Create Amalgam Project in Intellij IDE

• Click and goto workbench

• Create a maven project with Amalgam as groupid, artifact id, and name

• Add maven dependency for junit

• Add maven dependency for selenum-java

• Add maven surefire plugin to run the junit files

Page 16: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 15 of 27

WebDriver TestCase - Macys EnergyEfficient Test Case (exercise)

• Create the testcase in IntelliJ IDEA

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

• This test case demonstrates sendKeys in WebDriver

WebDriver TestCase - VisitWebSite (exercise)

• Create the testcase in IntelliJ IDEA

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

• This test case demonstrates select and navigate().back()

WebDriver TestCase - ClickAlert (exercise)

• Create the testcase in IntelliJ IDEA

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

• This test case demonstrates closeAlertAndGetItsText(), switchTo().alert() to accept() or dismiss()

WebDriver TestCase - CheckPopups (exercise)

• Create the testcase in IntelliJ IDEA

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

• This test case demonstrates getWindowHandle, switchTo().window(), switching to parentWindow

Page 17: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 16 of 27

WebDriver TestCase - CheckFrames (exercise)

• Create the testcase in IntelliJ IDEA

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

• This test case demonstrates switchTo().parentFrame(), switchTo().frame(), nested switchTo().parentFrame().switchTo().parentFrame();

• Creating methods to switch to different frames

• Usage of DriverUtils.delay()

Presentations

• Introduction to Webdriver

• Webdriver Waits

• Amalgam WebDriver IntelliJ IDE Project

Page 18: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 17 of 27

Day 4 AM & PM: - Data Driven Testing using JUnit (8 hours) This session provides detailed Data Driven Testing Concepts using JUnit with Examples. This session teaches both core Java concepts as well as how to use them along with a WebDriver Project.

Overview of Data Driven Testing Concepts

• What is Data Driven Methodology?

• What are data sources?

• What is a data pool?

• Advantages of using Data Driven Testing

• What is a test fixture?

• Flow of Data Driven Testing

• Different types of Data used for testing

• Related data set usages

• Architecture of Data Driven Testing

• Creating mature data driven testing process

• ZenPhoto WorkSpace Preparation (exercise)

Maven Concepts

• Installing Maven

• What is Maven?

• What is Maven’s Objectives?

• Features of Maven

• Typical Project Structure

• Project Object Model - POM

• What is Build Life Cycle?

• Running mvn in command line

• Maven Goals and Phase • Create ZenPhotoWorkSpace in IntelliJ IDEA

• Create a maven project with ZenPhoto as groupid, artifact id, and name

• Add maven dependency for junit in pom.xml file

• Add maven dependency for selenum-java in pom.xml file

• Add maven dependency for opencsv in pom.xml file

• Add maven dependency for poi in pom.xml file

• Add maven dependency for mysql-connector-java in pom.xml file

• Add maven surefire plugin to pom.xml file which allows to run the junit test cases using

• Add maven properties to set the compiler source and target in pom.xml file

• Add maven properties to set the project.build.sourceEncoding in pom.xml file

Page 19: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 18 of 27

Understanding CustomFormat core Java API's for data driven testing (exercise)

• Create CustomFormat.java

• Run and see the results

• Understand DecimalFormat format method

• Understand the pattern #,0,$,'.",',' etc

Understanding ReadProperty core Java API's for data driven testing (exercise)

• Create ReadProperty.java

• What is Java property file?

• How to use read Java property files using Properties

• copy the server.properties.txt into the src/test/resources

• Run and see the output, and correct any compile or other issues in the code

Understanding ReadText core Java API's for data driven testing (exercise)

• Create ReadText.java

• Understand BufferedReader in Java

• Check how the FileReader used in Java to read the text files

• EOF file check using not null comparison

• Read the text file contents show in the console

• Run and see the output, and correct any compile or other issues in the code

Understanding ReadCSV core Java API's for data driven testing (exercise)

• Create ReadCSV.java

• Understand java third party API's to resolve specific tasks

• How to use opencsv to read the CSV file contents

• copy the users.csv into the src/test/resources

• Run and see the output, and correct any compile or other issues in the code

Understanding ReadExcel core Java API's for data driven testing (exercise)

• Create ReadExcel.java

• Understand java third party API's available for handling Excel files in Java

• Understand what is apache-poi project

• What is the abbreviation of HSSF? What is the meaning of HSSF

• Understand Exel WorkBook, WorkSheet, Cols, Rows and Cell Details

• The Cell content can be a RichText, Integer, Formula, etc

• Using Iterator reading the workbook into a sheetData list

• Understanding try {} to open and close the resources

• Create the method printExelData to dump the contents of excel into console

• Run and see the output, and correct any compile or other issues in the code

Page 20: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 19 of 27

Understanding ReadDB core Java API's for data driven testing (exercise)

• Create ReadDB.java

• Understand java third party API's available for handling Reading Data Bases in Java

• Understand com.mysql.jdbc.Driver

• Using getConnection to connect to the database

• Use createStatement and executeQuery to get the ResultSet

• Looping the ResultSet and dump the contents of the database into console

• Run and see the output, and correct any compile or other issues in the code

ZenPhoto TestCase (exercise)

• Create a package com.kavinschool.zenphoto.tests in src/test/java

• Correct any compiler warnings and errors

• Run the test case for FirefoxDriver

• Correct any issues and re-run the test case for FirefoxDriver

Presentations

• Overview of Data Driven Testing

• ZenPhoto Data Driven TestSuites Exercises Sheet IntelliJ IDEA Project

• ZenPhoto Data Driven TestSuites JavaDoc with UML diagram

Page 21: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 20 of 27

Day 5 AM & PM : - Cucumber Concepts with Page Object Model (8 hours) This session provides Concepts on BDD and Cucumber using Java Language

BDD Concepts • What is BDD?

• What is the difference between BDD and TDD?

• BDD Tools

• Principals of BDD

Gherkin • What is Gherkin?

• How to create feature file?

• What are the keywords in Gherkin?

• Basic Feature file

• Feature file with Outline and Examples

• Feature file with Background

• Grouping the scenarios and tags

• Feature file with input data ✓ Inline variables ✓ Multiline Strings ✓ Tables

Installations • IntelliJ Plugins – Gherkin

• IntelliJ Plugins – Cucumber for Java

Cucumber Basic Concepts using Java • First Cucumber Test (exercise 1)

✓ Create a maven project in IntelliJ ✓ Add feature file containing scenarios in Test Resources directory. ✓ Add the maven dependency for Cucumber. ✓ Write step definitions and execute the tests from feature file. ✓ Setting up the Glue Property ✓ HTML Cucumber Report ✓ Comments with # or //

• Cucumber Annotations ✓ Given, When, Then ✓ And, But ✓ Scenario, Scenario Outline, Background, Examples

• Cucumber Execution ✓ Running Cucumber Feature File using IntelliJ

Page 22: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 21 of 27

✓ @RunWith(Cucumber.class) ✓ CucumberOptions

▪ Feature, glue, dryrun, monochrome ▪ Strict, plugin, name, snippets

✓ Running from maven pom.xml file.

Exploring Cucumber Concepts: • Filtering Scenarios (exercise 2)

✓ Using name to filter ✓ Using tags to filter

• Parameters (exercise 3) ✓ Passing parameters to step ✓ Passing data tables to step ✓ Using Maps (Key, Value pair) ✓ Using DataTables to using Objects

• Feature File Variations (exercise 4) ✓ Scenario Background ✓ Scenario Outline

• Running Cucumber ✓ Using Multiple Feature files ✓ Using Dry Run ✓ Using Tags

• Hooks and PicoContainer (exercise 5) ✓ Understanding Cucumber Hooks ✓ Understanding PicoContainer

Page 23: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 22 of 27

Day 6 AM & PM: - REST WebServices Concepts & Web Services Testing using UniRest & RestAssured Frameworks (8 hours)

REST

• Intro to REST

• REST Goals

• REST - How it works?

• REST - WSDL

• REST - WADL

• REST response format

• What is JSON?

• Examples of JSON

• REST Service Examples

• REST - Lets connect

• REST - Response received for your query

API Testing

• What is API Testing?

• Understanding N-tier architecture

• Exposing business layer

• Workflow of API

• API testing tools

• Types of API testing

• Advantages of API testing

• Challenges of API testing

• What to test?

• Unit vs. API testing

REST consuming using Curl

• Command Line REST testing with CURL

• Setting up CURL

• Configuring CURL to invoke REST calls

• Creating a simple automated test script

REST testing using Postman

• Installing Postman

• Performing simple tests

• Creating complex tests

Page 24: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 23 of 27

REST testing using Swagger

• Understanding Swagger

• Documentation, examples and usages

REST Automated Testing in Java

• RestAssured Framework

• Consuming Java using JSON JayWay Path

• JSON Templates and re-using with different values

Page 25: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 24 of 27

Day 7 AM & PM: - Mock & JMeter (8 hours)

Mocking ( 3 hours)

• Mock Objects

• What they are

• When and how to use them effectively

• Creating mocks

• Replacing mock objects with live objects

• Working with Mockito

Performance Testing with JMeter (5 hours)

• Installing JMeter

• What is JMeter?

• Advantages of JMeter

• How JMeter Works?

• Workflow of JMeter

• Execute from Cmd line mode

• Understanding JMeter

• WorkBench

• Test Plan

• Thread Groups

• Samplers

• Listeners

• View Results in Table

• Latency vs Sample Time

• Graph Results

• Throughput vs. Deviation

• View Results in Tree

• Configuration Elements

• Performance Test

• Load & stress Test

• JMeter Simulation

• JMeter Test Plan

• Thread vs Loop

• Ramp-up period

• Assertion

• Response Assertion

• Test Plan with Assertions

• Assertion Results

Page 26: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 25 of 27

Day 8 AM & PM – Appium & TestNG Concepts (8 hours)

TestNG Concepts ( 3 hours) • History of TestNG

• TestNG internal classes and annotations

• TestNG Config Annotations

• Understanding the order of execution

• OrderTest - create, modify, run and see the result

• Understanding @BeforeSuite, @BeforeTest, @BeforeClass, @BeforeMethod

• Understanding @AfterMethod, @AfterClass, @AfterTest, @AfterSuite

• using enaled attribute

• using alwaysRun

• using groups

• Annotation attributes (dependsOnGroups, dependsOnMethods,enabled, groups, inheritedGroups

• unsdetanding testng.xml

• testng.xml structure

• Creating and Running SquareSimpleTest

• testng_square_simple.xml - creating and running using testng control file

• understanding the results

TestNG Asserts Assertion methods

• pattern for parameters - actualValue, expectedValue [, message]

• Junit uses expectedValue, actualValue

• assertEquals, assertNotEquals - values equal?

• assertTrue, assertFalse - condition true?

• assertSame, assertNotSame - objects are same?

• assertEqualsNoOrder - arrays contain the same elements in no particular order?

• assertNull, assertNotNull - check NULL? Assertion Files

• assertDirectory - is directory?

• assertFile - is file?

• assertLength, assertMinLength, assertMaxLength - check total character in a file

• assertReadable, assertWriteable, assertReadWrite - check a file is read/writeable? Soft Assertions

• What is hard assert?

• What is soft assert?

• usage of softassert

• usage of assertAll

TestNG Parameters • Understanding Parameters

Page 27: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 26 of 27

• testng.xml - parameter tag - name, value pair

• Creating testng_rectangle_parameters.xml (exercise)

• Creating and running RectangleParameterTest (exercise)

• Using @Parameters

TestNG Data Providers • What is a data provider?

• Purpose of data provider

• Example of single data provider using Cube (exercise)

• Example of multiple data provider using Cube (exercise)

Running TestNg Suites • Running TestNG using Intellij IDE

• Run using testng.xml, Run method, Run As --> TestNG, from outline, from source code

• Running a single test from source code, running all test cases

• Running TestNG using Maven

• Adding dependency (exercise)

• Adding Maven surefile plugin (exercise)

Appium Concepts (5 hours)

• Mobile Testing

• Appium Philosophy

• Android – UIAutomator2

• Appium Inspector

• Appium Page Objects Locators

• Creating Testing cases in Appium

Hours for each session:

Course AM Session

PM Session

Total

Day 1 4 4 8

Day 2 4 4 8

Day 3 4 4 8

Day 4 4 4 8

Day 5 4 4 8

Day 6 4 4 8

Day 7 4 4 8

Day 8 4 4 8

Total 32 32 64

Page 28: Java, JMeter,Testing Frameworks & Selenium/WebDriver Preparation Course Level II... · Java, JMeter,Testing Frameworks & Selenium/WebDriver SDET – Preparation course Page 1 of 27

Java, JMeter,Testing Frameworks & Selenium/WebDriver

SDET – Preparation course Page 27 of 27

Course Outline: Course AM Session PM Session Total

Day 1 IntelliJ IDE, Core Java Basics, Annotation Basics

JUnit & WebDriver Introduction

8

Day 2 Basics of OOPS Concepts WebDriver Locator Strategy Concepts with Examples

8

Day 3 OOPS Concepts with Project, JavaDoc Concepts, Creating Annotations

WebDriver Amalgam Project

8

Day 4 Core Java Data Driven Concepts Data Driven Concepts with WebDriver

8

Day 5 Cucumber with Maven Concepts Cucumber with Page Object Model

8

Day 6 Rest Web Services Concepts UniRest, RestAssured Framework Concepts

8

Day 7 Mock Concepts JMeter Concepts 8

Day 8 TestNG Concepts Appium Concepts 8

Total 32 32 64

Note: The AM and PM session will have 15 minutes break. The break will be given when the

session logical break occurs. One-hour lunch break will be provided.