Selenium Tutorial for Beginner
1) Introducing Selenium
> Selenium is a suite of software tools to automate Web browsers.
(It is non a unmarried tool similar UFT, RFT, SilkTest etc..., Selenium automates spider web based applications only, It doesn't automate Desktop applications
UFT(formerly QTP) tin automate Desktop as well as Web applications.)
> It is opened upwards root software.
(Anybody tin download as well as role Selenium suite of tools alongside gratuitous of cost, but UFT, RFT etc... are Vendor tools)
> Selenium supports diverse operating environments.
Windows
UNIX
Macintosh etc...
(UFT / QTP supports Windows operating environs only)
> Selenium supports diverse browsers,
Mozilla Firefox
Google chrome
MS Internet Explorer
Opera
Safari etc...
> Selenium supports diverse programming languages to lift Test cases.
Java,
C#
Perl
Python
PHP
Ruby
-----
Use Java programming for Selenium
(We tin role anyone supporting programming linguistic communication for enhancing bear witness cases, Select Java Language.
Why Java for Selenium?
Most of the Selenium developers (nearly 77%) role Java as well as to a greater extent than assistance documentation as well as implementations available for java.
-------------------------------------
Select Selenium WebDriver + Java programming (Core Java- Java Fundamentals as well as OOPS) + TestNG Framework.
i) Selenium WebDriver -for identifying elements (objects) as well as performing operations on elements.
ii) Java programming - for enhancing Test cases
iii) TestNG - for Providing Test reports, grouping Test cases, Data driven Testing as well as parallel bear witness execution.
--------------------------------------------------------
2) History of selenium Project
> Selenium start came to life inward 2004
> WebDriver interface was launched at Google inward 2006.
> In 2008, WebDriver merged alongside Selenium RC, called every bit Selenium 2.0
Selenium IDE + Selenium RC + Selenium Grid - Selenium 1.0
Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid - Selenium 2.0
----------------------------------------------
3) Selenium License
All Selenium projects released nether the license of Apache 2.0
> Anybody tin download as well as role all selenium tools alongside gratuitous of cost.
> Anybody tin alter the root code.
> Anybody tin distribute the root code.
* Selling the modified code is non allowed.
--------------------------------------------------
4) Selenium supporting Platforms / Environments.
a) Application Environment
> It doesn't back upwards CUI based Application
> It doesn't back upwards I-tier as well as II-Tier Applications (Desktop or Windows based Applications)
> It supports spider web Applications (III-Tier to N-Tier)
> It supports Mobile Applications which are having spider web forms.
b) Operating Environment
> It supports MS Windows operating environment
> It supports UNIX operating environment
> It supports Mac operating environment
c) Web Browsers
> Supports Mozilla Firefox
> Supports IE
> Supports Google Chrome
> Safari
> Opera etc...
d) Programming languages
Java,
C#
PHP
Perl
Python
Ruby
--------------------------------------
5) Selenium Suite of Tools / Selenium Components
a) Selenium IDE
b) Selenium RC (* Out dated)
c) Selenium WebDriver
d) Selenium Grid
-------------------------
a) Selenium IDE
> It is a Firefox plug in.
> It is prototyping tool.
------------------------------
Features of Selenium IDE:
> Record as well as Playback Test Cases
> Type Test cases/test scripts using chemical component locators as well as Selenese commands / Selenium IDE commands
> Edit Test Cases
> Execute bear witness suites.
> debugging Test cases
> Export bear witness cases to other formats (programming languages)
* Selenium IDE Test example format is .html
----------------------------------------
Drawbacks of Selenium IDE:
> It supports Firefox browser only.
> It is prototyping tool, non suitable for complex bear witness cases.
> No Programming back upwards (No conditional as well as Loop statements etc...)
> Data Driven Testing is non possible.
> No detailed Test Reports (It provides summary only)
-------------------------------------------
b) Selenium RC (* Out Dated)
c) Selenium WebDriver
It is a Programming Interface, (It doesn't accept IDE)
WebDriver features:
> Create Test Cases / Test scripts using Element locators as well as Methods
> It supports Conditional as well as Loop statements
(Variables, Operators, Arrays, strings, Methods, Flow command statements, Methods, as well as OOPS concepts)
> It supports Java, C#, Perl, Python, Ruby as well as PHP languages for enhancing Test cases.
> Data driver testing is possible.
> Cross browser testing is possible.
Etc...
Drawbacks
It doesn't generate Test reports.
---------------------
d) Selenium Grid
Selenium Grid 2.0 supports Selenium WebDriver bear witness cases.
> It is used to grouping Test cases.
> It is used to execute Test cases inward parallel
> Generate Test Reports.
----------------------------------------
6) Selenium versus UFT
Selenium
i) Open Source, No license cost
ii) Selenium supports Web Application only
iii) Supports Firefox, IE, Chrome, Safari Opera etc...
iv) Supports Java, C#, PHP, Perl, Python as well as Ruby.
v) Use Element locators
vi) Supports Windows, UNIX as well as Macintosh etc...
vii) Limited back upwards for Image testing.
viii) Difficult to use.
ix) No reliable Technical support.
x) New features may non operate properly.
xi) No Object Repository, as well as hence no centralized maintenance of objects (elements)
xii) No authorized certification.
xiii) No integration alongside other tools
---------------------------------------
UFT (Formerly QTP)
i) Vendor tool (HP), License
ii) Supports Desktop/windows based as well as Web Applications
iii) IE, Firefox as well as Chrome.
iv) VBScript only
v) Based on add together ins
vi) MS Windows operating environs only.
vii) Rich back upwards for Image Testing
viii) Easy to use.
ix) HP provides Technical support
x) New features volition operate properly.
xi) Centralized maintenance of Objects
xii) HP conducts certification exam
xiii) UFT tin survive integrated alongside ALM/QC for Test Management
--------------------------------------
UFT Selenium
Test/Test script Test Case / Test Script
Object Element
Property Locator
----------------------------------------------
7) Frameworks as well as plug ins used inward Selenium
a) Frameworks
i) JUint
> It is a framework for Unit testing as well as it tin survive used for selenium Functional tests also
> It is used to execute bear witness batches as well as generate Test reports.
----------------
TestNG
> Grouping Test cases as well as Execute bear witness groups.
> generate HTML bear witness reports
> Parallel Test execution
> Executing multiple programs / classes using XML file.
-----------------------------------------
Plug ins used inward selenium
i) Firebug as well as Firepath for inspecting elements, It is for Firefox browser.
Note: For IE as well as Google Chrome built inward developers tools available (F12)
-------------------------------------------------------
Edit box - Element / Object
id - Locator
Email - Value
Method / Operation - Entering a Value (ex: gcrindia@gmail.com)
---------------------------------
Man - Object / Element
Name - locator
Rovil - Value
----------------------------------
8) Advantages of Selenium
> It is opened upwards source, anybody tin download as well as use.
> It supports diverse programming languages for enhancing Test cases.
> It supports diverse operating environments
> It supports Parallel bear witness execution
> It supports diverse browsers
> It uses less hardware resources.
---------------------------------------
9) Disadvantages of selenium
> Since it is Open root software, no reliable technical support.
> It doesn't back upwards Desktop Applications.
> Limited back upwards for Image Testing
> No centralized maintenance of elements/objects
> Difficult to role when it compares to Vendor tools (Ex: UFT, RFT etc...)
> New features may non operate properly.
> No integration alongside other tools for Test management
-----------------------------------------------------
10) Choose Selenium Tools
Choose Selenium IDE (If you lot don't accept programming knowledge)
Or
Choose selenium Webdriver (If you lot accept programming knowledge)
Choose Java for programming.
Firebug as well as Firepath plug ins to inspect elements for Firefox browser
* If it is IE or Chrome built-in developer tools available (F12)
TestNG Framework to execute Test batches as well as Generate Test reports
-------------------------------------
11) Configure Selenium
Java, Selenium WebDriver, TestNG
> Download as well as Java (JDK) as well as Install
> Set Environment (Path) variable path to access Java software from whatever directory.
> Download Eclipse IDE (To write as well as execute Java programs)
> Download as well as Install WebDriver (Java bindings) from www.selniumhq.com as well as add together Webdriver jounce files to Java projection (in Eclipse)
> Download as well as install Firebug as well as Firepath plug ins to inspect elements inward Firefox browser
> Download IE, Chrome etc... Browsers drivers (If you lot desire execute bear witness cases on IE as well as Chrome browsers)
Note: Firefox browser driver is built- inward in Selenium Webdriver.
> Download as well as install TestNg from Eclipse IDE.
-----------------------------------------------
1) Introducing Selenium
> Selenium is a suite of software tools to automate Web browsers.
(It is non a unmarried tool similar UFT, RFT, SilkTest etc..., Selenium automates spider web based applications only, It doesn't automate Desktop applications
UFT(formerly QTP) tin automate Desktop as well as Web applications.)
> It is opened upwards root software.
(Anybody tin download as well as role Selenium suite of tools alongside gratuitous of cost, but UFT, RFT etc... are Vendor tools)
> Selenium supports diverse operating environments.
Windows
UNIX
Macintosh etc...
(UFT / QTP supports Windows operating environs only)
> Selenium supports diverse browsers,
Mozilla Firefox
Google chrome
MS Internet Explorer
Opera
Safari etc...
> Selenium supports diverse programming languages to lift Test cases.
Java,
C#
Perl
Python
PHP
Ruby
-----
Use Java programming for Selenium
(We tin role anyone supporting programming linguistic communication for enhancing bear witness cases, Select Java Language.
Why Java for Selenium?
Most of the Selenium developers (nearly 77%) role Java as well as to a greater extent than assistance documentation as well as implementations available for java.
-------------------------------------
Select Selenium WebDriver + Java programming (Core Java- Java Fundamentals as well as OOPS) + TestNG Framework.
i) Selenium WebDriver -for identifying elements (objects) as well as performing operations on elements.
ii) Java programming - for enhancing Test cases
iii) TestNG - for Providing Test reports, grouping Test cases, Data driven Testing as well as parallel bear witness execution.
--------------------------------------------------------
2) History of selenium Project
> Selenium start came to life inward 2004
> WebDriver interface was launched at Google inward 2006.
> In 2008, WebDriver merged alongside Selenium RC, called every bit Selenium 2.0
Selenium IDE + Selenium RC + Selenium Grid - Selenium 1.0
Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid - Selenium 2.0
----------------------------------------------
3) Selenium License
All Selenium projects released nether the license of Apache 2.0
> Anybody tin download as well as role all selenium tools alongside gratuitous of cost.
> Anybody tin alter the root code.
> Anybody tin distribute the root code.
* Selling the modified code is non allowed.
--------------------------------------------------
4) Selenium supporting Platforms / Environments.
a) Application Environment
> It doesn't back upwards CUI based Application
> It doesn't back upwards I-tier as well as II-Tier Applications (Desktop or Windows based Applications)
> It supports spider web Applications (III-Tier to N-Tier)
> It supports Mobile Applications which are having spider web forms.
b) Operating Environment
> It supports MS Windows operating environment
> It supports UNIX operating environment
> It supports Mac operating environment
c) Web Browsers
> Supports Mozilla Firefox
> Supports IE
> Supports Google Chrome
> Safari
> Opera etc...
d) Programming languages
Java,
C#
PHP
Perl
Python
Ruby
--------------------------------------
5) Selenium Suite of Tools / Selenium Components
a) Selenium IDE
b) Selenium RC (* Out dated)
c) Selenium WebDriver
d) Selenium Grid
-------------------------
a) Selenium IDE
> It is a Firefox plug in.
> It is prototyping tool.
------------------------------
Features of Selenium IDE:
> Record as well as Playback Test Cases
> Type Test cases/test scripts using chemical component locators as well as Selenese commands / Selenium IDE commands
> Edit Test Cases
> Execute bear witness suites.
> debugging Test cases
> Export bear witness cases to other formats (programming languages)
* Selenium IDE Test example format is .html
----------------------------------------
Drawbacks of Selenium IDE:
> It supports Firefox browser only.
> It is prototyping tool, non suitable for complex bear witness cases.
> No Programming back upwards (No conditional as well as Loop statements etc...)
> Data Driven Testing is non possible.
> No detailed Test Reports (It provides summary only)
-------------------------------------------
b) Selenium RC (* Out Dated)
c) Selenium WebDriver
It is a Programming Interface, (It doesn't accept IDE)
WebDriver features:
> Create Test Cases / Test scripts using Element locators as well as Methods
> It supports Conditional as well as Loop statements
(Variables, Operators, Arrays, strings, Methods, Flow command statements, Methods, as well as OOPS concepts)
> It supports Java, C#, Perl, Python, Ruby as well as PHP languages for enhancing Test cases.
> Data driver testing is possible.
> Cross browser testing is possible.
Etc...
Drawbacks
It doesn't generate Test reports.
---------------------
d) Selenium Grid
Selenium Grid 2.0 supports Selenium WebDriver bear witness cases.
> It is used to grouping Test cases.
> It is used to execute Test cases inward parallel
> Generate Test Reports.
----------------------------------------
6) Selenium versus UFT
Selenium
i) Open Source, No license cost
ii) Selenium supports Web Application only
iii) Supports Firefox, IE, Chrome, Safari Opera etc...
iv) Supports Java, C#, PHP, Perl, Python as well as Ruby.
v) Use Element locators
vi) Supports Windows, UNIX as well as Macintosh etc...
vii) Limited back upwards for Image testing.
viii) Difficult to use.
ix) No reliable Technical support.
x) New features may non operate properly.
xi) No Object Repository, as well as hence no centralized maintenance of objects (elements)
xii) No authorized certification.
xiii) No integration alongside other tools
---------------------------------------
UFT (Formerly QTP)
i) Vendor tool (HP), License
ii) Supports Desktop/windows based as well as Web Applications
iii) IE, Firefox as well as Chrome.
iv) VBScript only
v) Based on add together ins
vi) MS Windows operating environs only.
vii) Rich back upwards for Image Testing
viii) Easy to use.
ix) HP provides Technical support
x) New features volition operate properly.
xi) Centralized maintenance of Objects
xii) HP conducts certification exam
xiii) UFT tin survive integrated alongside ALM/QC for Test Management
--------------------------------------
UFT Selenium
Test/Test script Test Case / Test Script
Object Element
Property Locator
----------------------------------------------
7) Frameworks as well as plug ins used inward Selenium
a) Frameworks
i) JUint
> It is a framework for Unit testing as well as it tin survive used for selenium Functional tests also
> It is used to execute bear witness batches as well as generate Test reports.
----------------
TestNG
> Grouping Test cases as well as Execute bear witness groups.
> generate HTML bear witness reports
> Parallel Test execution
> Executing multiple programs / classes using XML file.
-----------------------------------------
Plug ins used inward selenium
i) Firebug as well as Firepath for inspecting elements, It is for Firefox browser.
Note: For IE as well as Google Chrome built inward developers tools available (F12)
-------------------------------------------------------
Edit box - Element / Object
id - Locator
Email - Value
Method / Operation - Entering a Value (ex: gcrindia@gmail.com)
---------------------------------
Man - Object / Element
Name - locator
Rovil - Value
----------------------------------
8) Advantages of Selenium
> It is opened upwards source, anybody tin download as well as use.
> It supports diverse programming languages for enhancing Test cases.
> It supports diverse operating environments
> It supports Parallel bear witness execution
> It supports diverse browsers
> It uses less hardware resources.
---------------------------------------
9) Disadvantages of selenium
> Since it is Open root software, no reliable technical support.
> It doesn't back upwards Desktop Applications.
> Limited back upwards for Image Testing
> No centralized maintenance of elements/objects
> Difficult to role when it compares to Vendor tools (Ex: UFT, RFT etc...)
> New features may non operate properly.
> No integration alongside other tools for Test management
-----------------------------------------------------
10) Choose Selenium Tools
Choose Selenium IDE (If you lot don't accept programming knowledge)
Or
Choose selenium Webdriver (If you lot accept programming knowledge)
Choose Java for programming.
Firebug as well as Firepath plug ins to inspect elements for Firefox browser
* If it is IE or Chrome built-in developer tools available (F12)
TestNG Framework to execute Test batches as well as Generate Test reports
-------------------------------------
11) Configure Selenium
Java, Selenium WebDriver, TestNG
> Download as well as Java (JDK) as well as Install
> Set Environment (Path) variable path to access Java software from whatever directory.
> Download Eclipse IDE (To write as well as execute Java programs)
> Download as well as Install WebDriver (Java bindings) from www.selniumhq.com as well as add together Webdriver jounce files to Java projection (in Eclipse)
> Download as well as install Firebug as well as Firepath plug ins to inspect elements inward Firefox browser
> Download IE, Chrome etc... Browsers drivers (If you lot desire execute bear witness cases on IE as well as Chrome browsers)
Note: Firefox browser driver is built- inward in Selenium Webdriver.
> Download as well as install TestNg from Eclipse IDE.
-----------------------------------------------