Skip to main content

Java Centre

If you are new to programming or have least experience with programming then I would recommend you to watch following java training videos first before embarking on learning Selenium.
If you are well versed with java programming language then you can directly move to selenium webdriver training videos
Following java training videos are tailored for selenium but they can also be used to learn java (or at least core java in general). The Java projects used in the video tutorials are available on GitHub at javatutorial and on seleniumtests_with_java.

Please don't use these programs to write selenium tests as selenium tests require a robust framework. Once you are skilled at java then may like to try Selenium Tests Automation Framework to write your selenium tests in java.

So bookmark this page to keep track of new videos :-)

So here we go -

Training Video Content

Training Videos

Introduction to java technology

Downloading community version of IDEA

Installing Java

Running your first java program

Beginning with Java

Introduction to Object

Introduction to Class

Inroduction to Inheritance

Introduction to Package

Introduction to selenium API

OOPS and Java

Introduction to Variables

Introduction to Arrays

Control flow statements in java

Java Language Basics

Access specifiers 

Defining methods - instance and class methods

Overloaded methods

Passing variable argument to method

Return value from method

Using this keyword

Static initializer

Java Classes, objects and method

Enum Type - 

   With and without parameter

   Creating Enum in Intellij

Iterating through values of enum

Instance Initialization

Switch Statement 

Enum and switch statement

Interface in java

implementing an interface

Overriding method in interface

Using interface type

Down casting

Selenium examples

Interface and Java


  Raw Type 

Generic Type 


Exception Hierarchy - 

Types of exceptions -

Checked Exception 

Unchecked Exception -




Handling Exception with try - catch - finally block

Specifying the exception

Exception classes in WebDriver

Generics and Exception

The core collection interfaces.

List, Set, Map 

Important collection methods 

Introduction to ArrayList -

Introduction to HashSet -

Introduction to HashMap -

Traversing collection using for each loop and Iterator Object

Introducing java collection framework

Using collection framework with webdriver - 

Array List example 

Set Example

HashMap example

Java Collection framework and Selenium Webdriver

Date and time operations -  

generate time in ms 

calculate time difference between two operations 

creating date instance using java.util.Date 

compare dates, which date is ahead? 

accessing year, month day etc for a given calendar 

generating future/past dates 

formatting date 

a complex example - generating future date for USA time zone

Date and Time operations

File System -  

      retrieving absolute file path

copy file to another file

read txt file

read property file

parsing xml file

Handling files in java

Database operations with java (JDBC) -   

establishing connection   
executing select query
executing update query


Dealing with multiple form objects

  • Form with many fields
  • How to not write bloated data objects
  • Builder pattern comes for rescue


IDEA hacks

This session covers -
  • Refactor - > Encapsulate fields
  • Refactor - rename
  • Code generation - > Generate getter, setters, toString, equals etc. Ex
  • Conditional Debug points
  • Cmd + shift +a to search anything
  • Analyze stacktrace


Intro to java 8 and selenium using java 8

This session covers -
  • Why is java 8 so popular?
  • I do not java yet : -/
  • What is FunctionalInterface?
  • Functional programming and Lambda
  • Interface having method with no argument
  • Interface having method with one argument
  • What if AnimalHavingMethodArgument has two abstract methods?
  • And what next? > Future training videos sneak peak using java 8 and selenium?


Java 8 part 2: Stream filter operations and Selenium WebDriver

This session covers -
  • List operations in java 8
    • Using stream with List
    • Filter stream
    • FindFirst
  • Intro to method references
  • Intermediate operations (i.e. filter, map)
  • Terminal operation (forEach, findFirst, reduce, collect)
  • WebDriver and list examples using java 8

java-8-part-2-Stream filter operations and Selenium WebDriver

Java 8 part 3: Stream map operations and Selenium WebDriver

This session covers -
  • Some more gran on lambda
  • Intro. to Stream > map api (Forget about Map api for now :))
  • How lambda returns a value?
  • Using predicate static variable and method references
  • WebDriver and map examples using java 8
  • Debugging map operation on data point


Java 8 part 4: Optional and Selenium WebDriver

This session covers -
  • Java 8 part 4: Optional and Selenium WebDriver (yes learning Optional is not optional :))
  • Why Optional > What happen when data is null
  • Optional > an object which may or may not contain non null values (some prefer to call it empty value)
  • Do you remember where we used Optional?  :) com.seleniumtests.java8.ListExamples class > findFirst()
  • Creating Optional using - of, ofNullable, orElse  
  • WebDriver examples with Optional >    
    • Default locale
    • Testing with different data sets i.e. lower and upper case


Java 8 part 5: IntStream, sum, avg, reduce, file reading operations and SeleniumWebDriver

This session covers -
  • Method implementation on interface with java 8 - static and default methods, wtf??
  • IntStream.range()
  • More Stream operations -    
    • sum, sort, average
    • And how do I add double numbers?
  • Reading from file
  • Collectors.toMap 
  • Where are the WebDriver examples??


Java 8 part 6: Stream cont. and Selenium WebDriver

This session covers -
  • Different ways of creating Stream
    • empty stream, stream of collection, stream of string objects, stream builder, stream generate method with limit and iterate
  • Stream of primitives
    • int, long and double streams using IntStream, LongStream, DoubleStream interfaces
  • Stream of File
  • Streams can not be reused
  • How to eliminate expensive operations
  • And what is parallel stream?? 
  • And some WebDriver examples


Java 8 part 7: Back to basics and Selenium WebDriver

This session covers -

  • PECS > Producer extends Consumer super
  • Remember Generics which provide type safety?:
  • What are “extends”, “super” and bounded wild card?
  • <? extends T> and <? super T> WTF ??? 
  • map(Function<? super T, ? extends R> mapper) example from com.seleniumtests.tests.web.SeleniumWithJava8Session6#usingJava8
    • forEach(Consumer<? super T> action)
    • PECS on Jav8 > Stream examples -


IDEA Hack 2

This session covers -

  • Presentation assistant plugin
  • Double shift > search any where 
  • Search class name using first letters    
    • Go to specific line on file i.e. filename:linenumber
    • Searching folders i.e. /resources
  • Recent files > cmd+E
  • Project pane > cmd+1
  • Creating new file/package etc > cmd/ctrl + N
  • Auto scroll from source
  • Move one or multiple lines without cut and paste
    • select + option + shift + arrow up/down
  • Turn off presentation assistant plugin


REST API Testing

This session covers -

  • REST Assured Maven dependency, 
REST Assured Includes JsonPath and XmlPath  to parse json and xml documents respectively

  • API used in testing: 
Passing parameters between tests using extract method

  • Set base URI
  • With and without Gherkins syntax
  • Data driven test with query, path parameters and Curly bracket notation
  • Operations around Get


Popular posts from this blog

How to write bad UI automation code (a formal guide)

You might find umpteen resources on learning to write UI automation. But rarely you find any guide on writing bad automation code. Bad automation code is not actually "bad" especially when you consider following - Bad automation code keeps you job safe. Well who can understand the code other than you. Gives you an opportunity to ask for more raise as you are the only one who can maintain the code you write Lets you keep your head up as you the geek of your company who knows that abstruse code  Now coming to writing bad automation code, here are some silver bullets - Record and Replay is the core or writing good (read bad) automation code. It has so many advantages which just out do many others. Biggest being you don't have to write any good code (read bad), tool does it for you. The way to convince decision owners in to enlightening is to let them know that record and replay does not require any special skills. Even your HR can do this.

Using chrome console to test xPath and css selectors

Since the advent of selenium there have been many plugin to test xPath / css selectors but you don’t need any of them if you have chrome browser. Using Chrome console you can test both xPath and css selectors. Launch website to be tested in chrome browser and hit F-12 and you would see chrome console opened in lower pane of application - Hit escape key and console would open another pane to write element locators - And now you can start writing xPath or css selectors in chrome console and test them - The syntax for writing css id - $$(“ ”) And hit the enter key. If your expression is right then html snippet of the application element corresponding to the css selector would be displayed - If you mouse over the html snippet in chrome console then it would highlight the corresponding element in application - If you want to clean console of previously written element selectors then just hit ctrl+L keys and chrome console would be empty again. Pro

Verify email confirmation using Selenium

Email confirmation seems to be integral part of any registration process. I came across an application which lets you provide your email address. You can follow the sign up link in you mail and then complete the registration process. Lets consider we provide GMail address for it. Now if were to use only Selenium then we would have to follow following steps - Launch GMail using Selenium; Some how search for new mail in the list of available mails; Some how click on it; Parse the mail message; Get the registration link; Follow up with registration process What do you think of an approach in which you can