SlideShare a Scribd company logo
Foundation Selenium
Webdriver (java)
2 days training
Who is the training for?
•

Ideal for manual testers wanting to move into
automation testing

•

No programming knowledge required

•

Testers involved with website testing

•

Testers wanting to gain technical skills

!2

www.time2test.co.uk
High level
•
•
•

•

TestNG and jUnit

Selenium configuration

•

ANT

•

Cross Browser
XPATHS and CSS Selectors

•

•

Selenium overview

•

•

Firebug and Firepath

•

Website testing

Selenium IDE
Selenium RC
Java for Selenium

•

Java OOP concepts

•

Forms and Webdriver

•

Eclipse IDE and Maven

•

Excel and Webdriver

!3

www.time2test.co.uk
What will you learn?
•

Selenium overview and configuration

•

Test Frameworks - testNG and jUnit
Frameworks

•

Selenium IDE ( user extensions, record,
playback, JavaScript, IDE to Webdriver)

•

ANT integration with Webdriver

•

Cross Browser testing using Webdriver

•

XPATHS and CSS location strategies

•

Firebug and Firepath

•

Website testing using Webdriver
( hyperlinks, Buttons, Input boxes,
attachments)

•

Forms and Webdriver

•

Excel and Webdriver

•

•

•

•

Selenium RC ( cross browser testing,
start and stop, command line usage )
Java for Selenium (SDK, features,
variables, functions, loops,
constructors, interfaces)
Java OOP concepts (Class, Objects in
Java, Inheritance in Java, Java
Packages, exception handling)
Eclipse IDE ( download, versions,
common jars, installation) and MAVEN

!4

www.time2test.co.uk
schedule
Day 1

Day 2

•

Selenium IDE and RC

•

Webdriver

•

Java

•

jUnit and testNG

•

Java OOP

•

cross browser

•

Environment

•

xpaths and css

•

Eclipse and Maven

•

firebug and firepath

!5

www.time2test.co.uk
What’s new?
“We have raised the learning bar for our foundation level
training with more emphasis on Selenium Webdriver and
Java.”	

•

More focus on Webdriver API

•

More focus on Java for Web-driver

•

Less focus on Selenium IDE and Selenium RC

•

More focus on ANT and jUnit
!6

www.time2test.co.uk
Environment
overview
•

Eclipse IDE

•

JDK - versions

•

Java version

•

Maven

•

installation and configuration

!8

www.time2test.co.uk
download and use

•

We need to use many different software
components on a variety of different hardware and
operating systems.

!9

www.time2test.co.uk
Eclipse IDE

•

Editor

•

Let the magic of Eclipse help with programming

!10

www.time2test.co.uk
maven
•

manages the software package dependencies and
versions.

•

we will use Eclipse’s built in maven support

•

can be used via command line

!11

www.time2test.co.uk
maven

•

dependencies

•

pom file

!12

www.time2test.co.uk
Java
Aim
•

Aim is to learn enough Java for Testers that will
allow you to develop Webdriver test scripts.

•

too much detail at the Java level will deter you from
moving to Webdriver.

!14

www.time2test.co.uk
overview
•

Variables

•

Functions

•

Loops

•

Constructors

•

Interfaces

!15

www.time2test.co.uk
High level terms
•

objects - has behaviours/states - a web page has
states - links, buttons, forms, images and
behaviours like form submission, link navigation

•

class - blueprint that describes behaviours/states
for an object

•

methods - are behaviours

•

instance variables - values assigned to instance
variables
!16

www.time2test.co.uk
Basics
•

case sensitive

•

class names - start with upper case

•

method names - start with lower case

•

saving files - save as the class name ( eclipse will
do this)

•

main() - mandatory for java program ( not if you use
jUnit)
!17

www.time2test.co.uk
Basics 2
•

java identifiers - variables, classes, methods use names - begin with
character or underscore

•

java modifiers
•
•

•

access - default, protected, private, public
non access - final, abstract

java variables
•

local

•

class ( static)

•

instance ( non static)
!18

www.time2test.co.uk
java keywords
abstract

assert boolean

break byte

case catch char

class const continue default do doubleelse
final

finally float

instanceof

for goto

if

int interface long

enum extend

implements

import

native newpackage

private protected public return short static strictfp
super switch synchronized this
transient try void
!19

throw throws

volatilewhile
www.time2test.co.uk
Say Hello
•

Very First Java Program

•

what does it mean?

!
public class HelloWorld {	
!
	 public static void main(String[] args) {	
!
	 	 System.out.println("Hello to java for Webdriver");	
	 }	
!
}	

!20

www.time2test.co.uk
simple case study
•

class

•

objects

•

constructors

•

instance variables

!21

www.time2test.co.uk
Date

Date d = new Date();
// will give you the date and time

!22

www.time2test.co.uk
variables
•

integer

•

double

•

string

•

char

!23

www.time2test.co.uk
methods - functions
•

without a return value - void

•

with return values

•

take inputs as parameters

!24

www.time2test.co.uk
arrays
•

integer array

•

string array

•

object array

!25

www.time2test.co.uk
multi arrays

String x[][] = new String[3][4];

!26

www.time2test.co.uk
conditions

•

greater than, less than… > ,< , <=, >=, !

•

comparators - and &&, or ||, equals ==

!27

www.time2test.co.uk
statements
•

if , then ,

•

if, then, else if

•

switch statement

!28

www.time2test.co.uk
loops
•

while

•

for

•

do while

!29

www.time2test.co.uk
loops - while
•

while(expression)

•

{
//block of code to run

•
•

}

!30

www.time2test.co.uk
loops - for
•

for(initialization; expression; update_statement)

•

{
//block of code to run

•
•

}

!31

www.time2test.co.uk
loops - do while
•

do

•

{

•
•

//block of code to run
} while(expression);

!32

www.time2test.co.uk
random

•

Random inputs for forms based testing

!33

www.time2test.co.uk
exceptions example

•

catch those exceptions and print them out

!34

www.time2test.co.uk
comments

•

multiple /* */

•

single line //

!35

www.time2test.co.uk
Java OOP
overview
•
•

constructors

•

inheritance

•

packages

•

getter and setter
methods

objects

•

•

class

exceptions
!37

www.time2test.co.uk
class

// field, constructor, and
// method declarations

!38

www.time2test.co.uk
constructors

Constructor declarations look like method declarations—except that they use
the name of the class and have no return type

!39

www.time2test.co.uk
getter and setter methods

•

Define methods which allow you to read the values
of the instance variables and to set them. These
methods are called setter and getter.

!40

www.time2test.co.uk
objects

A typical Java program creates many objects, which interact by invoking
methods.

!41

www.time2test.co.uk
overriding

If a class inherits a method from its super class, then there is a chance to
override the method provided that it is not marked final.

!42

www.time2test.co.uk
inheritance

•

class extends an existing class

!43

www.time2test.co.uk
encapsulation

•

encapsulation is also referred to as data hiding.

!44

www.time2test.co.uk
abstraction

•

Abstraction refers to the ability to make a class
abstract in OOP. An abstract class is one that
cannot be instantiated.

!45

www.time2test.co.uk
interfaces

An interface is a collection of abstract methods. A class implements an
interface, thereby inheriting the abstract methods of the interface.

!46

www.time2test.co.uk
polymorphism

Polymorphism is the ability of an object to take on many forms. The most
common use of polymorphism in OOP occurs when a parent class reference is
used to refer to a child class object.

!47

www.time2test.co.uk
packages

•

folder structure

!48

www.time2test.co.uk
exceptions
•

Large topic area - lets focus on what we need for
web driver and appreciate high level
•

try

•

catch

•

finally

•

throw
!49

www.time2test.co.uk
try - catch

•

Do something and attempt to catch the exception.

•

View the java docs to see what type of exceptions
can be caught

!50

www.time2test.co.uk
enum
•

An enum type is a special data type that enables for a variable to be a set of
predefined constants.

•

Use them to reduce potential errors in your code

!
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
}

!

!51

www.time2test.co.uk
jUnit
overview
•

background

•

integration with Eclipse

•

notation

•

assertions

•

maven

•

examples
!53

www.time2test.co.uk
notation
•

@Test - Mark your test cases with @Test annotations

•

@Before and @After - use for “setup” and
“tearDown” methods respectively. They run before
and after every test case.

•

@BeforeClass and @AfterClass - Use for class wide
“setup” and “tearDown” respectively. They run for
one time before and after all test cases.

•

@Ignore - ignore a test case
!54

www.time2test.co.uk
Assertions
•

assertEquals([String message], expected, actual) - Tests that two values are
the same. Note: for arrays the reference is checked not the content of the
arrays.

•

assertTrue([message], boolean condition) - Checks that the boolean condition
is true.

!55

www.time2test.co.uk
testNG
overview
•

integration with Eclipse

•

notation

•

maven

•

examples

•

@DataProvider and @Parameters

•

differences between jUnit and testNG
!57

www.time2test.co.uk
annotations
•

@BeforeClass - oneTimeSetUp

•

@BeforeMethod - setUp

•

@Test - testEmptyCollection

•

@AfterMethod - tearDown

•

@BeforeMethod - setUp

•

@Test - testOneItemCollection

•

@AfterMethod - tearDown

•

@AfterClass - oneTimeTearDown
!58

www.time2test.co.uk
@Parameters

•

xml files to grab parameters for tests

!59

www.time2test.co.uk
@DataProviders

•

test data as inputs

!60

www.time2test.co.uk
Test Results

TestNG by default generates a different type of report for its test execution.
This includes an HTML and an XML report output.

!61

www.time2test.co.uk
ant
overview
•

what is ant?

•

command line usage

•

benefits

•

ant and testNG

!63

www.time2test.co.uk
Webdriver
overview

•

more details coming soon

!65

www.time2test.co.uk
locating webelements
overview

•

more details coming soon

!67

www.time2test.co.uk
alerts and cookies
overview

•

more details coming soon

!69

www.time2test.co.uk
wait strategies
overview

•

more details coming soon

!71

www.time2test.co.uk
cross browser
overview

•

more details coming soon

!73

www.time2test.co.uk
data driven

•

Excel spreadsheets or CSV files to seed your tests

!74

www.time2test.co.uk
know how
overview

•

more details coming soon

!76

www.time2test.co.uk
Selenium IDE and RC
overview
•

Selenium IDE!
•
•

javascript functions and random variables

•
•

install and use

record and playback

Selenium RC!
•

download and use

•

cross browser
!78

www.time2test.co.uk
Jenkins
overview
•

more details to follow

!80

www.time2test.co.uk
Conclusions
goals and objectives
•

Review your goals.

•

Have we met your expectations?

•

Email us and we will setup a follow up Skype
session

!82

www.time2test.co.uk
Thank you

•

From the Time2test Team

!83

www.time2test.co.uk

More Related Content

PDF
Expert selenium with core java
PPTX
Basic Selenium Training
PPT
Java Basics for selenium
PDF
Selenium Basics Tutorial
DOCX
Selenium WebDriver FAQ's
PPT
Testing Java Web Apps With Selenium
PDF
Automation Abstraction Layers: Page Objects and Beyond
PPTX
An overview of selenium webdriver
Expert selenium with core java
Basic Selenium Training
Java Basics for selenium
Selenium Basics Tutorial
Selenium WebDriver FAQ's
Testing Java Web Apps With Selenium
Automation Abstraction Layers: Page Objects and Beyond
An overview of selenium webdriver

What's hot (20)

PDF
Testing Angular
PPTX
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
PDF
How To Use Selenium Successfully
PPT
Selenium Concepts
PDF
Webdriver cheatsheets summary
PDF
Selenium webdriver interview questions and answers
PDF
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
PPTX
Selenium using Java
 
PDF
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
PDF
Automation Testing using Selenium Webdriver
PPTX
Automation Testing by Selenium Web Driver
PPTX
Selenium with java
PDF
How To Use Selenium Successfully (Java Edition)
PPT
Introduction to Selenium
PPTX
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
PDF
Join the darkside: Selenium testing with Nightwatch.js
PDF
Selenium interview questions and answers
PDF
Introduction To Web Application Testing
PDF
Selenium Introduction by Sandeep Sharda
PDF
Selenium RC: Automated Testing of Modern Web Applications
Testing Angular
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
How To Use Selenium Successfully
Selenium Concepts
Webdriver cheatsheets summary
Selenium webdriver interview questions and answers
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Selenium using Java
 
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Automation Testing using Selenium Webdriver
Automation Testing by Selenium Web Driver
Selenium with java
How To Use Selenium Successfully (Java Edition)
Introduction to Selenium
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Join the darkside: Selenium testing with Nightwatch.js
Selenium interview questions and answers
Introduction To Web Application Testing
Selenium Introduction by Sandeep Sharda
Selenium RC: Automated Testing of Modern Web Applications
Ad

Viewers also liked (20)

PPTX
Selenium_WebDriver_Training__@2012_-phil_coulson_
PPTX
Maven TestNg frame work (1) (1)
PPTX
Continuous test automation
PDF
The Future of Ecommerce - Web 2.0
PPTX
ElasticPath: Commerce and Content, Together At Last by Brian Gilmore & Spence...
PPTX
Full Scale Automation Using Selenium
PPTX
Scrum master motivation role
PPTX
AWS CloudFormation Automation, TrafficScript, and Serverless architecture wit...
PPTX
Prioritization by value (DevOps, Scrum)
PDF
Selenium bootcamp slides
PDF
AWS OpsWorks for Chef Automate
ODP
DevOps and Chef improve your life
PDF
Behat bdd training (php) course slides pdf
PPTX
Coding using jscript test complete
PPTX
Gherkin for test automation in agile
PDF
DbOps, DevOps and Ops
PPTX
Devops Journey - internet tech startup
PPTX
Scrum master's role - top 20 challenges
PDF
Global Payment System- Reference Architecture
DOCX
Realtime selenium interview questions
Selenium_WebDriver_Training__@2012_-phil_coulson_
Maven TestNg frame work (1) (1)
Continuous test automation
The Future of Ecommerce - Web 2.0
ElasticPath: Commerce and Content, Together At Last by Brian Gilmore & Spence...
Full Scale Automation Using Selenium
Scrum master motivation role
AWS CloudFormation Automation, TrafficScript, and Serverless architecture wit...
Prioritization by value (DevOps, Scrum)
Selenium bootcamp slides
AWS OpsWorks for Chef Automate
DevOps and Chef improve your life
Behat bdd training (php) course slides pdf
Coding using jscript test complete
Gherkin for test automation in agile
DbOps, DevOps and Ops
Devops Journey - internet tech startup
Scrum master's role - top 20 challenges
Global Payment System- Reference Architecture
Realtime selenium interview questions
Ad

Similar to Foundation selenium java (20)

PPTX
Selenium web driver_2.0_presentation
PDF
Selenium syllabus
PDF
Selenium Online Training.pdf
PDF
Selenium Online Training.pdf
PDF
Selenium Online Training.pdf
PDF
Selenium Online Training.pdf
PDF
Selenium Online Training.pdf
PDF
Expert selenium with core java
PDF
Selenium Online Training
PDF
selenium automation software testing course syllabus TheKiranAcademy_compress...
PDF
Android testing-with-selenium-webdriver Online Training
PDF
SOFTWARE TESTING
PDF
Selenium-with-Java-Course-Content-Magnitia.pdf
PDF
Selenium-with-Java-Course-Content-Magnitia.pdf
PPT
selenium training | selenium course | selenium video tutorial | selenium for ...
PPTX
Selenium online training
PPTX
Selenium online training in india
PDF
QA / Testing Tools, Automation Testing, Online & Classroom Training
PDF
Testing-Tools-Magnitia-Content.pdf
PPTX
Selenium online training in India
Selenium web driver_2.0_presentation
Selenium syllabus
Selenium Online Training.pdf
Selenium Online Training.pdf
Selenium Online Training.pdf
Selenium Online Training.pdf
Selenium Online Training.pdf
Expert selenium with core java
Selenium Online Training
selenium automation software testing course syllabus TheKiranAcademy_compress...
Android testing-with-selenium-webdriver Online Training
SOFTWARE TESTING
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdf
selenium training | selenium course | selenium video tutorial | selenium for ...
Selenium online training
Selenium online training in india
QA / Testing Tools, Automation Testing, Online & Classroom Training
Testing-Tools-Magnitia-Content.pdf
Selenium online training in India

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
MIND Revenue Release Quarter 2 2025 Press Release
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Foundation selenium java