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






Generics:

  Raw Type 

Generic Type 

Exception:  

Exception Hierarchy - 

Types of exceptions -


Checked Exception 

Unchecked Exception -

Error

RunTimeException 

 

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

JDBC




Dealing with multiple form objects

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

how-do-you-deal-with-multiple-form?





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

idea-hacks







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-intro-and-sneak-peak-into-selenium-using-java8






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-3-map-operations-and-selenium-webdriver







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-4-optional-and-selenium-webdriver








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-5-intstream-sum-avg-reduce







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-6-stream-cont-and-selenium-webdriver








Java 8 part 7: Back to basics and Selenium WebDriver

This session covers -

  • PECS > Producer extends Consumer super
  • Remember Generics which provide type safety?: https://www.seleniumtests.com/p/java-training-tutorial-videos.html
  • 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 -

java-8-part-7-back-to-basics







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

intellij-idea-hack2





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: https://reqres.in/ 
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



Comments

Popular posts from this blog

Appium and android mobile app automation

Next appium and Android mobile app automation video tutoria l is live. If you are new to appium then please check - appium-tutorial This video tutorial covers - Start vysor (Just for this session and not mobile automation :)) Start appium and start appium inspector Desired Capabilities platformName - Android deviceName - L2N0219828001013 (as seen on "adb devices") Saved Capability Sets Start Session Scan app elements using appium inspector Get appPackage and appActivity using "APK info" app Install "APK info" app and open app whose appPackage and appActivity are required i.e. calculator Check top section of app icon com.android.calculator2 is app package com.android.calculator2.Calculator is app activity testng.xml file settings for running Android app tests Test details com.seleniumtests.tests.mobile.AndroidAppTest and CalculatorScreen class View beautiful STF test report  

Verify email confirmation using Selenium

Note: If you are new to java and selenium then start with selenium java training videos .     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

Selenium Tutorial: Ant Build for Selenium Java project

Ant is a build tool which could be used to have your tests running either from command line or from Hudson CI tool. There is detailed documentation available for ant here but probably you need to know only a little part of it for you selenium tests. The essentials which are needed to know are: Project Target (ant execution point and collection of tasks) Tasks (could be as simple as compilation) And there would usually be following targets for Selenium tools - setClassPath - so that ant knows where you jar files are loadTestNG - so that you could use testng task in ant and use it to execute testng tests from ant init - created the build file clean - delete the build file compile - compiles the selenium tests run - executes the selenium tests Here is my project set up for ant -