This 2-day training course covers Selenium WebDriver with Java for manual testers looking to learn automation testing. It teaches the Selenium tooling and framework including Selenium IDE, RC, WebDriver, Java concepts, TestNG, jUnit, ANT and more. The course provides hands-on experience building automated test scripts with a focus on WebDriver API and using Java for test development.
2. 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
3. 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
4. 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
5. 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
6. 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
9. 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
11. 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
14. 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
16. 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
17. 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
18. 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
19. 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
20. 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
40. 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
41. objects
A typical Java program creates many objects, which interact by invoking
methods.
!41
www.time2test.co.uk
42. 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
45. 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
46. 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
47. 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
49. 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
50. 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
51. 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
54. 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
55. 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
61. 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
82. 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