Selenium Tutorial 2
Overview of Selenium Part-2
vii) Frameworks used inwards Selenium:
a) JUnit:
It is framework for Unit testing,
It tin hold out used for Selenium functional tests also
JUnit is used to execute Test batches as well as generating Reports
b) TestNg:
It is used to execute Test batches as well as generating reports
It is has built inwards HTML, XLM Reports
------------------------------------
viii) Advantages of Selenium
> It is opened upward origin tool, nosotros tin download usage
> It supports diverse operating environments (Windows, UNIX, Mac etc...)
> It supports diverse programming languages to practice as well as execute Tests
> It supports all pop spider web browsers
> It supports parallel seek out execution
> It uses less Hardware resources
----------------------------------------
ix) Disadvantages of selenium
> Since it is opened upward origin tool, No reliable Technical support
(Official Users Group, Chat room inwards seleniumhq.org)
> It doesn't back upward Desktop Applications/Windows bases applications
> No Other tool integration for Test management
> Difficult to use
> New features may non piece of occupation properly
> Deployment of selenium is hard than UFT as well as RFT tools
--------------------------------------
x) Choose Selenium Tools
Choose Selenium IDE (If you lot don't convey programming knowledge)
-------------------------------------
WebDriver (If you lot convey programming knowledge)
Java Programming Language
WebDriver alongside Java
Firebug as well as Firepath Add ons for inspecting UI elements
TestNG Framework to execute Test batches as well as generating Test Reports.
------------------
xi) Configure Selenium
> Download as well as Install Java (JDK)
> Download as well as Install Eclipse (To write as well as Execute Java programs)
> Download WebDriver Interface (Java bindings) from seleniumhq.org as well as deploy inwards Eclipse
> Download as well as install Firebug as well as Firepath inwards Mozilla browser
> Download as well as install TestNg framework
------------------------------------------------------------------
Software Test Process/STLC Test Planning
Test Design
Test Execution
Test Closure
-----------------------------
UFT Test Process
Planning
Generating Basic Tests
Enhancing Tests
Running as well as Debugging Tests
Analyzing Test Results
Reporting Defects
----------------------------
Session 3: Selenium Test Process
Phase I: Test Planning
> Get Application Environment details (UI design, as well as Database) from evolution squad
> Analyze the AUT inwards price of UI elements Identification
Using Selenium IDE Recording feature
Or
Using Firebug (It tin hold out used to inspect UI elements)
> Select Test cases for Automation
Tests that nosotros convey to execute on every construct (Sanity tests)
Tests that nosotros convey to execute on every modified build(Regression Tests)
Tests that nosotros convey execute using multiple sets of Test information (Data Driven Tests)
> Select Framework (TestNG) as well as configure
-----------------------------------------------
Phase II) Generating Basic Tests
In UFT:
a) Object Repository based Test Design (Recording, Keyword driven methodology)
b) Descriptive Programming (Static, Dynamic Programming)
--------------------
In Selenium:
a) Using Recording characteristic inwards Selenium IDE / Type Test scripts using UI elements locators as well as Selenium commands
b) Write Test scripts using UI elements locators inwards Selenium RC(Out dated)
c) Write Test scripts using UI elements locators inwards WebDriver interface
Note: In Selenium no object Repository, then no centralized maintenance of Objects/UI Elements
Phase III : Enhancing Tests
Insert Verification points
Add comments
Parametrization
Synchronization
Working alongside files
Error handling
Etc...
-----------------------
Phase IV: Running as well as Debugging Tests
Single Test Run
Batch Testing
Using JUnit or TestNg frameworks nosotros tin execute Test batches
Debugging Tests
> Locating as well as Isolating Errors thru stride yesteryear stride execution
> Debugging is non required for all tests.
> Whenever Test is non showing whatever errors as well as non providing right output
Phase V: Analyzing Test Result
Status of Test Result inwards Functional Test Automation
Pass (If expected termination = Actual Result)
Fail (If expected termination <> Actual Result)
Done (Test execution without errors, No verifications)
Warning (Interruption during seek out execution)
Define Test Result:
WebDriver doesn't convey whatever Built-in Test study generator
Using programmatic statements nosotros tin generate seek out Results
Using TestNg nosotros tin generate Test Reports
Phase VI: Reporting Defects
Functional Test Automation Defect Management
---------------------------------------------------------
Selenium Manual (No tool support)
---------------------------------------------------------------
Selenium Bugzilla or whatever tool
------------------------------------------------------------
Session 4: Java Language for Selenium
Why Java for Selenium?
> Selenium written inwards Java, it doesn't hateful that Java solely to a greater extent than compatible alongside selenium, nosotros tin usage other supported languages also.
> Good back upward for Selenium alongside Java, You tin acquire to a greater extent than attention documents as well as implementations from Internet.
> Majority of Selenium Testers(nearly 77%) using Java, then cognition sharing is rattling easy.
> Java is platform independent language, nosotros tin usage it on whatever Operating environment.
How much Java is required for Selenium?
> For Test Automation using Selenium Core Java cognition is sufficient, Advanced Java non required.
> Java Basics as well as Object Oriented Concepts are required.
We tin segregate Java for Selenium into 2 categories.
A) Java Basics
B) Java Object Oriented Programming
----------------------
a) Overview on Java
> Java Programming Language was developed yesteryear Dominicus Microsystems inwards 1995, Now it is subsidiary of Oracle corporation.
> Java is an Object Oriented programming Language, In Java, everything is an Object. Java tin hold out easily extended since it is based on the Object model.
> Java is a Platform independent Language. It tin hold out compiled as well as interpreted.
> Java is Simple, It is tardily to acquire as well as implement.
> coffee is Securable, using Java nosotros tin railroad train virus gratis as well as tamper gratis systems.
b) Java Environment Setup
We convey to setup coffee environs to write as well as execute Java programs, It varies from 1 operating organisation to another.
> If it is DOS (from Command prompt inwards Windows), install coffee Software(JDK) as well as gear upward Environment variables.
> If it is Windows GUI, install Java as well as Eclipse(Java Editor) to write as well as execute Java programs
c) Java Syntax
> Java is illustration sensitive language(deference is in that place inwards betwixt upper as well as lower illustration letters)
Ex: Identifiers UFT as well as uft convey unlike pregnant inwards java
> First alphabetic quality of a Class Name should hold out inwards upper case.
> Method names should outset alongside lower illustration letter
> Java Program file mention should just check alongside degree name.
> world static void principal (String args[])- Java plan execution starts from principal method, which is mandatory inwards every coffee program.
> Every tilt should halt alongside semi colon symbol.
d) Usage of Java
> Developing Desktop Applications (Ex: Acrobat Reader)
> Developing Web Applications
> Developing Enterprise Applications (ex: banking, Insurance Applications)
> developing mobile applications
> Embedded systems
> smart cards
> Games etc...
--------------------------------------------------
A) coffee Basics
i) Comments inwards Java
Purpose of comments
> To brand the code readable
> To brand the Disable from execution
Java supports Single business comment as well as multiple lines comment.
------------------------
ii) Data Types inwards Java
There are ii categories of Data types inwards Java
a) Primitive information types
b) Reference information types
------------------------
iii) Variables
a) Local variables
b) Instance variables
c) Class / Static variables
------------------------
iv) Java Modifiers
Modifiers are used to gear upward access levels for Classes, variables, methods etc...
a) Access Modifiers (Default, Public, Private, Protected)
b) Non-access Modifiers (Static, Final, Abstract, Synchronized)
------------------------
v) Operators inwards java
Operators are used to perform mathematical, comparing as well as logical operations.
Categories of operators:
a) Arithmetic
b) Relational operators
c) Bitwise operators
d) Logical operators
e) Assignment operators
f) Mise Operators
------------------------
vi) Conditional statements
Used to insert verification points as well as for fault handling.
Types of conditional statements inwards Java:
a) If Statement
b) Switch statement
Types of Condition:
a) Single condition
b) Compound conditions
c) Nested conditions
Usage of conditional statements:
a) Executing a block of statements when status is true.
b) Execute a block of statements when status is truthful otherwise execute around other block of statements.
c) Decide amid several alternates (Else if)
d) Executing a block of statements when to a greater extent than than 1 status is true.(Nested if)
e) Decide amid several alternates (Switch statement)
------------------------
vii) Loop statements
used for repetitive execution.
Types of Loop Statements
a) For Loop
b) While Loop
c) Do...While Loop
d) Enhanced For Loop (mainly used for Arrays)
------------------------
Selenium Tutorial iii
Overview of Selenium Part-2
vii) Frameworks used inwards Selenium:
a) JUnit:
It is framework for Unit testing,
It tin hold out used for Selenium functional tests also
JUnit is used to execute Test batches as well as generating Reports
b) TestNg:
It is used to execute Test batches as well as generating reports
It is has built inwards HTML, XLM Reports
------------------------------------
viii) Advantages of Selenium
> It is opened upward origin tool, nosotros tin download usage
> It supports diverse operating environments (Windows, UNIX, Mac etc...)
> It supports diverse programming languages to practice as well as execute Tests
> It supports all pop spider web browsers
> It supports parallel seek out execution
> It uses less Hardware resources
----------------------------------------
ix) Disadvantages of selenium
> Since it is opened upward origin tool, No reliable Technical support
(Official Users Group, Chat room inwards seleniumhq.org)
> It doesn't back upward Desktop Applications/Windows bases applications
> No Other tool integration for Test management
> Difficult to use
> New features may non piece of occupation properly
> Deployment of selenium is hard than UFT as well as RFT tools
--------------------------------------
x) Choose Selenium Tools
Choose Selenium IDE (If you lot don't convey programming knowledge)
-------------------------------------
WebDriver (If you lot convey programming knowledge)
Java Programming Language
WebDriver alongside Java
Firebug as well as Firepath Add ons for inspecting UI elements
TestNG Framework to execute Test batches as well as generating Test Reports.
------------------
xi) Configure Selenium
> Download as well as Install Java (JDK)
> Download as well as Install Eclipse (To write as well as Execute Java programs)
> Download WebDriver Interface (Java bindings) from seleniumhq.org as well as deploy inwards Eclipse
> Download as well as install Firebug as well as Firepath inwards Mozilla browser
> Download as well as install TestNg framework
------------------------------------------------------------------
Software Test Process/STLC Test Planning
Test Design
Test Execution
Test Closure
-----------------------------
UFT Test Process
Planning
Generating Basic Tests
Enhancing Tests
Running as well as Debugging Tests
Analyzing Test Results
Reporting Defects
----------------------------
Session 3: Selenium Test Process
Phase I: Test Planning
> Get Application Environment details (UI design, as well as Database) from evolution squad
> Analyze the AUT inwards price of UI elements Identification
Using Selenium IDE Recording feature
Or
Using Firebug (It tin hold out used to inspect UI elements)
> Select Test cases for Automation
Tests that nosotros convey to execute on every construct (Sanity tests)
Tests that nosotros convey to execute on every modified build(Regression Tests)
Tests that nosotros convey execute using multiple sets of Test information (Data Driven Tests)
> Select Framework (TestNG) as well as configure
-----------------------------------------------
Phase II) Generating Basic Tests
In UFT:
a) Object Repository based Test Design (Recording, Keyword driven methodology)
b) Descriptive Programming (Static, Dynamic Programming)
--------------------
In Selenium:
a) Using Recording characteristic inwards Selenium IDE / Type Test scripts using UI elements locators as well as Selenium commands
b) Write Test scripts using UI elements locators inwards Selenium RC(Out dated)
c) Write Test scripts using UI elements locators inwards WebDriver interface
Note: In Selenium no object Repository, then no centralized maintenance of Objects/UI Elements
Phase III : Enhancing Tests
Insert Verification points
Add comments
Parametrization
Synchronization
Working alongside files
Error handling
Etc...
-----------------------
Phase IV: Running as well as Debugging Tests
Single Test Run
Batch Testing
Using JUnit or TestNg frameworks nosotros tin execute Test batches
Debugging Tests
> Locating as well as Isolating Errors thru stride yesteryear stride execution
> Debugging is non required for all tests.
> Whenever Test is non showing whatever errors as well as non providing right output
Phase V: Analyzing Test Result
Status of Test Result inwards Functional Test Automation
Pass (If expected termination = Actual Result)
Fail (If expected termination <> Actual Result)
Done (Test execution without errors, No verifications)
Warning (Interruption during seek out execution)
Define Test Result:
WebDriver doesn't convey whatever Built-in Test study generator
Using programmatic statements nosotros tin generate seek out Results
Using TestNg nosotros tin generate Test Reports
Phase VI: Reporting Defects
Functional Test Automation Defect Management
---------------------------------------------------------
Selenium Manual (No tool support)
---------------------------------------------------------------
Selenium Bugzilla or whatever tool
------------------------------------------------------------
Session 4: Java Language for Selenium
Why Java for Selenium?
> Selenium written inwards Java, it doesn't hateful that Java solely to a greater extent than compatible alongside selenium, nosotros tin usage other supported languages also.
> Good back upward for Selenium alongside Java, You tin acquire to a greater extent than attention documents as well as implementations from Internet.
> Majority of Selenium Testers(nearly 77%) using Java, then cognition sharing is rattling easy.
> Java is platform independent language, nosotros tin usage it on whatever Operating environment.
How much Java is required for Selenium?
> For Test Automation using Selenium Core Java cognition is sufficient, Advanced Java non required.
> Java Basics as well as Object Oriented Concepts are required.
We tin segregate Java for Selenium into 2 categories.
A) Java Basics
B) Java Object Oriented Programming
----------------------
a) Overview on Java
> Java Programming Language was developed yesteryear Dominicus Microsystems inwards 1995, Now it is subsidiary of Oracle corporation.
> Java is an Object Oriented programming Language, In Java, everything is an Object. Java tin hold out easily extended since it is based on the Object model.
> Java is a Platform independent Language. It tin hold out compiled as well as interpreted.
> Java is Simple, It is tardily to acquire as well as implement.
> coffee is Securable, using Java nosotros tin railroad train virus gratis as well as tamper gratis systems.
b) Java Environment Setup
We convey to setup coffee environs to write as well as execute Java programs, It varies from 1 operating organisation to another.
> If it is DOS (from Command prompt inwards Windows), install coffee Software(JDK) as well as gear upward Environment variables.
> If it is Windows GUI, install Java as well as Eclipse(Java Editor) to write as well as execute Java programs
c) Java Syntax
> Java is illustration sensitive language(deference is in that place inwards betwixt upper as well as lower illustration letters)
Ex: Identifiers UFT as well as uft convey unlike pregnant inwards java
> First alphabetic quality of a Class Name should hold out inwards upper case.
> Method names should outset alongside lower illustration letter
> Java Program file mention should just check alongside degree name.
> world static void principal (String args[])- Java plan execution starts from principal method, which is mandatory inwards every coffee program.
> Every tilt should halt alongside semi colon symbol.
d) Usage of Java
> Developing Desktop Applications (Ex: Acrobat Reader)
> Developing Web Applications
> Developing Enterprise Applications (ex: banking, Insurance Applications)
> developing mobile applications
> Embedded systems
> smart cards
> Games etc...
--------------------------------------------------
A) coffee Basics
i) Comments inwards Java
Purpose of comments
> To brand the code readable
> To brand the Disable from execution
Java supports Single business comment as well as multiple lines comment.
------------------------
ii) Data Types inwards Java
There are ii categories of Data types inwards Java
a) Primitive information types
b) Reference information types
------------------------
iii) Variables
a) Local variables
b) Instance variables
c) Class / Static variables
------------------------
iv) Java Modifiers
Modifiers are used to gear upward access levels for Classes, variables, methods etc...
a) Access Modifiers (Default, Public, Private, Protected)
b) Non-access Modifiers (Static, Final, Abstract, Synchronized)
------------------------
v) Operators inwards java
Operators are used to perform mathematical, comparing as well as logical operations.
Categories of operators:
a) Arithmetic
b) Relational operators
c) Bitwise operators
d) Logical operators
e) Assignment operators
f) Mise Operators
------------------------
vi) Conditional statements
Used to insert verification points as well as for fault handling.
Types of conditional statements inwards Java:
a) If Statement
b) Switch statement
Types of Condition:
a) Single condition
b) Compound conditions
c) Nested conditions
Usage of conditional statements:
a) Executing a block of statements when status is true.
b) Execute a block of statements when status is truthful otherwise execute around other block of statements.
c) Decide amid several alternates (Else if)
d) Executing a block of statements when to a greater extent than than 1 status is true.(Nested if)
e) Decide amid several alternates (Switch statement)
------------------------
vii) Loop statements
used for repetitive execution.
Types of Loop Statements
a) For Loop
b) While Loop
c) Do...While Loop
d) Enhanced For Loop (mainly used for Arrays)
------------------------
Selenium Tutorial iii