Selenium Tutorial 3


Selenium Tutorial 3

Session 1: Overview on Test Automation
    a) Advantages together with Disadvantages of Manual Testing
    b) Advantages together with Disadvantages of Test Automation
    c) Types of Test Tools
    d) ATLM (Automation Test Life cycle Methodology)
 

Session 2: ) Overview on Selenium    
a) Introducing Selenium
    b) History of the Selenium Project
    c) Selenium License
    d) Selenium suite of tools
    e) Advantages of Selenium
    f) Disadvantages of Selenium
    g) Selenium Vs UFT
    h) Frameworks used inwards Selenium
    i) Choose Selenium Tools
    j) Configure Selenium

Session 3: Selenium Test Process    

    a) Test Planning
    b) Generating Basic Tests
    c) Enhancing Tests
    d) Running together with Debugging Tests
    e) Analyzing Test Results together with Reporting Defects

Session 4: Java for Selenium    

    a) Why coffee for selenium?
    b) How much Java is required for Selenium?
    c) Overview on Java
    d) Java Environment Setup
--------------------
A) Java Basics
    1) Comments
    2) Data Types
    3) Variables
    4) Modifiers
    5) Operators
    6) Conditional statements
    7) Loop statements


Session 4: Java Language for Selenium Part-2

viii) Arrays inwards Java
 

Generally, Array is a collection of like type of elements.

In Java, Array is an object that contains elements of like information types.

Java Array is index based, index starts from zero.

The length of an Array is established when the Array is created together with Array length is fixed.

Each item inwards an Array is called an Element.

Declaration of Arrays

Assigning values to elements

Advantages together with Disadvantages of Arrays.
-----------------------------------
ix) Java Methods
Methods are also known every bit procedures or functions

A Java method is a collection of statements that are grouped together to perform an operation.

Ex:

System.out.println

If you lot telephone yell upward the method, the organization truly executes several statements, inwards fellowship to display a message on the console.

We tin practise methods alongside or without returning whatever value.

Basically Methods are ii types

a) Built-in or pre-defined    Number Methods
    Character methods
    String methods
    Date & Time Methods
    Etc...

b) User defined    Method alongside returning value
    Method without returning whatever value
-------------------------------------------------
x) Regular Expressions
It is a formula for matching patterns, Influenza A virus subtype H5N1 Regular aspect defines search pattern for strings.

Java provides the java.util.regex bundle for pattern matching alongside regular expressions.
--------------------------------------------------------
xi) File together with I/O operations inwards Java.
The java.io bundle contains classes to perform input together with output (I/O) operations inwards Java.

Reading using input devices

Displaying on the console

Reading together with writing text files

Working alongside Excel files.
---------------------------------------------------------
xii) Exception treatment inwards Java
In Computer programming, Exception is an abnormal condition.

An exception is an number that occurs during the execution of a plan that disrupts the normal menstruum of instructions.

The exception treatment inwards coffee is 1 of the powerful machinery to grip the runtime errors together with therefore that normal menstruum of the application tin endure maintained.
----------------------------------------------------------
Java object oriented Programming
Class, Object, Method
In object oriented programming system(OOPS), nosotros designing a plan using Objects together with classes.

Object:

It is an entity that has states together with behaviors is known every bit Object.

Ex: Pen, Chair, Table, Computer etc...

States / Properties of Dog object are color, height, weight etc... together with behaviors moving, barking, jumping etc...
-------------------
Class:

Class is a template or designing from alongside objects are created.

A Class a grouping of objects that has mutual properties.
----------------
Method: An functioning on Object.
--------------------------------------------
i) Inheritance
Inheritance is a machinery inwards which 1 object acquires all the properties together with behaviors of raise object.

Using Inheritance nosotros tin practise classes that are built upon existing classes.

When nosotros Inherit from an existing class, nosotros tin reuse methods together with fields from raise cast together with nosotros tin add together novel methods together with fields also.

Java Supports:

a) Single Inheritance

b) Multi degree Inheritance

c) Hierarchical Inheritance

Note: Java doesn't back upward Multiple Inheritance.
--------------------------------------------------------
ii) Polymorphism
If a cast having multiple methods alongside same name, but dissimilar parameters is known every bit method overloading.

Method overloading increases the readability of the program.

There are ii ways to overload the method inwards Java

a) yesteryear changing number of arguments
Ex:
add (int a, int b)

add (int a, int b, int c)

b) yesteryear changing information types

Ex:
add (int a, int b)
add (char a, char b)

In Object Oriented programming overriding agency to override the functionality of an existing method.

Method overriding provides a specific implementation of a method that is already provided yesteryear its super cast (Parent class)

It is used for runtime polymorphism.
-------------------------------------------
Polymorphism
------------------
It is a concept yesteryear which nosotros tin perform a unmarried inwards dissimilar ways.

Polymorphism derived from ii Greek give-and-take poly together with morphs

Poly agency -many
morphs agency -forms / ways, together with therefore polymorphism agency many forms.

we bring ii types of Polymorphism inwards java

a) Compile fourth dimension polymorphism
b) Runtime polymorphism.

We tin perform polymorphism inwards coffee yesteryear method overloading together with method overriding.
--------------------------------------------------
iii) Abstraction
Abstraction is a physical care for of hiding the implementation details together with showing functionality to the user.

Another way, it shows of import things to the user together with hides internal details.

Ex: Sending email

you simply type the e-mail together with send, you lot don't internal physical care for of the e-mail delivery.

Abstraction focuses on what the object does instead of how it does.

In ii ways nosotros tin accomplish Abstraction

a) Abstract Class (0 to 100%)

b) Interface (100%)
--------------------------------------------------
iv) Encapsulation
Encapsulation is 1 of the 4 key oops concepts, other iii are Inheritance, Polymorphism together with Abstraction.

Encapsulation is a physical care for of wrapping code together with information together into a unmarried unit.

Ex: Capsule (mixed of several medicines)

It provides the command over the data, suppose nosotros desire to value of the id greater than 100 only, nosotros tin write the logic within the setter method.
------------------------------------------------------
Java packages
A Java bundle is a grouping of like type of classes, interfaces together with sub-packages.

There are ii types of coffee packages

a) Built inwards packages

Ex: io, util, sql etc...

b) User defined packages

----------------------------------------------
Interfaces inwards Java
An interface is a collection of abstract methods.

An interface is non a class, writing an interface is like to writing a class, but ii are dissimilar concepts.
------------------------------------------------------
Java for Selenium (Core Java)

A) Java Basics
    Comments, Data types, Variables, Constants, Operators, Conditional statements,
    Loop statements, Araays, Methods, Regular expressions, File together with I/O operations, Exception handling.

B) Java Object Oriented Concepts
    Inheritance, Abstraction, Polymorphism, Encapsulation
    Method Overloading together with Overriding.
-----------------------------------------------
Java Environment Setup, Java Program Structure/ JavaSyntax
 

A) Java Environment Setup

> Download Java (JDK) together with Install

> Set Environment Variable (Path variable)

How to laid (windows 7):

Select MyComputer together with Right click

> Properties

> Advanced System Settings

> Environment Variables

> Select New inwards System Variables

> Enter Variable every bit Path

> Enter Jdk bin directory path (C:\Program Files\Java\jdk1.8.0_40\bin) inwards Value field

> Ok > OK >OK
------------
Verify the Java Environment:
---------------------------
Launch command prompt

> Type Java (it provides details)
------------------------------------
Steps:

1) Download Java (JDK) software together with Install

2) Set Environment Variable (Path variable) inwards fellowship access Java from whatever directory inwards C Drive.

3) Verify the Java Environment setup using coffee or javac commands.
---------------------------------------------
3 steps for writing together with executing Java programs
1) Write Java plan inwards Notepad (Editor)

2) Compile the plan (It creates Class file)

Command prompt > Change to Program file directory

> Type javac Program name.java (java is extension, javac is coffee command for compilation)


3) Run / execute the Program (Output)

> Type coffee infinite Program name
It provides output on the console
--------------------------------------
Java Sample Program:
public cast Sample{

public static void psyche (String [] args){

System.out.println ("Hello Java World");

}

}

Note:

i) First alphabetic lineament of the cast advert should endure upper representative value

ii) Class advert together with plan file advert every bit to same.
--------------------------------------------------
Download Eclipse software together with unzip

What is Eclipse (IDE-Integrated evolution environment)

It is a Platform to practise together with execute Java programs, Perl, Python, Ruby together with PHP etc...

It provides Editor, Context help, assistance for syntax errors, Auto compilation together with debugging.


Open Eclipse psyche folder

> Click Eclipse file

It launches Eclipse IDE
-----------------------
Create Java Project
    -> Create a Package
        -> Create Class / Interface
-------------------------------------
Java Program Structure / Java Syntax
1) Package announcement statement

ex:

package Saturday;

Note: Package is used to shop together with Organize Classes based on functionality.

It must endure outset inwards our Java Program

2) Import statements

Import statements are kept later on the bundle statement

We tin import Built inwards together with User defined packages /Libraries

Ex:

import java.io.Console;

import is a keyword to import built inwards / user defined packages

java is Project

io is package

Console is a cast inwards io package
-------------------
import java.io.*;

It loads/imports all classes from io package

3) Class announcement statement

Ex:
public cast Sample {
}

public is access modifier

class keyword to declare a class

Sample - advert of the Class
-----------------------------

Selenium Tutorial 4

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post