0% found this document useful (0 votes)
13 views

Ste Final

software testing msbte

Uploaded by

hackpacket0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Ste Final

software testing msbte

Uploaded by

hackpacket0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

SOFTWARE TESTING

SELENIUM

What is Selenium?
Selenium is a free (open source) automated testing suite for web applications across different browsers
and platforms.

Selenium is a suite of software tools to automate Web Browsers.

• It is an Open source suite of tools mainly used for Functional and Regression Test Automation.

Selenium is a free (open source) automated testing suite for web applications across different browsers
and platforms.
It is quite similar to HP Quick Test Pro (QTP now UFT) only that Selenium focuses on automating web-
based applications. Testing done using Selenium tool is usually referred as Selenium Testing.

• Selenium supports various Operating environments.


✓ MS Windows

✓ Linux

✓ Macintosh etc…

• Selenium supports various Browsers.


✓ Mozilla Firefox

✓ IE

✓ Google Chrome

✓ Safari

✓ Opera etc…

Note: Selenium IDE supports Mozilla Firefox only.

• Selenium supports various programming environments to write programs (Test


scripts)
✓ Java

✓ C#

✓ Python

✓ Perl

✓ Ruby

✓ PHP

• History of the Selenium Project


SOFTWARE TESTING

Selenium first came to life in 2004.

• In 2006, Selenium WebDriver was launched at Google.

• In 2008, the whole Selenium team decided to merge Selenium WebDriver with Selenium RC in order to
form more powerful tool called Selenium 2.0

✓ Selenium 1
(Selenium IDE + Selenium RC + Selenium Grid)

✓ Selenium 2
(Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid)
SOFTWARE TESTING

• Selenium’s Tools Suite


Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an
organization.

It has four components.

• Selenium Integrated Development Environment (IDE)


• Selenium Remote Control (RC)
• WebDriver
• Selenium Grid

Brief Introduction Selenium IDE

It is a Firefox browser plug in, used to create and execute Test cases.

• Selenium IDE Features:


• Create Test Cases, Test suites (We can Record test cases or type Test steps using element locators and
Selenese commands)

• Edit Test Cases

• Execute Test cases, Test suites

• Debug Test Cases.

• Enhance Test Cases

• Export Test cases to other formats (java, ruby etc…)

Note: selenium IDE Test case default format is .html


SOFTWARE TESTING

• Drawbacks of Selenium IDE


• It supports Mozilla Firefox browser only.

• It doesn’t support Programming logic/features to enhance Test cases.

• It doesn’t support Data Driven Testing.

• It is not suitable for complex test case design.

• No centralized maintenance of Objects/Elements

2. Selenium RC (* Out dated) -Currently, Selenium RC is still being developed but only in
maintenance mode.

• Selenium WebDriver

✓ It is a Programming interface to create and execute Test cases.

Selenium IDE has IDE but doesn’t have Programming interface

✓ Selenium WebDriver has Programming interface but doesn’t have IDE

✓ It communicates Directly to the browser.

✓ No need of Separate Server such as RC Server

✓ UFT/QTP has both IDE as well as Programming interface

✓ Faster Execution than IDE & RC

• Selenium WebDriver supports various programming environments to write programs.

✓ Java,

✓ C#

✓ Perl

✓ Python

✓ Ruby

✓ PHP

• Using Element/Object locators/properties and Webdriver Methods we can create and execute Test cases.

• Selenium Webdriver supports various browsers to create and execute test case/test script/test

Note: Browser driver varies from one browser to another.


SOFTWARE TESTING

✓ MS Windows

✓ Linux Macintosh etc…

Drawback of Selenium WebDriver

• It doesn’t generate detailed Test Reports.

• No centralized maintenance of Object/elements

• It require Programming Knowledge

• cannot support the readily new browser

• Installation is More Complicated than Selenium IDE

• No built-in mechanism for logging runtime message

3. Selenium Grid

• Selenium Grid is used to execute tests across multiple browsers, operating environments and machines
in parallel.
• Selenium Grid 2 supports Selenium RC Tests as well as Selenium WebDriver Tests.
i) Selenium WebDriver to create Test cases using element locators and Webdriver methods.
ii) Java Programming to enhance test cases.

iii) TestNG Framework to group test cases, execute test batches and generate detailed test reports.
Features:

• Enables simultaneous running of tests in multiple browsers and environments.


• Saves time enormously.
• Utilizes the hub-and-nodes concept. The hub acts as a central source of Selenium commands to
each node connected to it.

Note on Browser and Environment Support

• Because of their architectural differences, Selenium IDE, Selenium RC, and WebDriver support
different sets of browsers and operating environments.

Selenium
IDE WebDriver

Browser Mozilla Internet Explorer versions 6 to 11, both 32 and 64-bit


Support Firefox
Microsoft Edge version 12.10240 & above ( partial support some
SOFTWARE TESTING

Selenium
IDE WebDriver

functionalities under development)


Firefox 3.0 and above
Google Chrome 12.0. and above
Opera 11.5 and above
Android - 2.3 and above for phones and tablets
(devices & emulators)

iOS 3+ for phones (devices & emulators) and 3.2+ for tablets (devices &
emulators)

HtmlUnit 2.9 and above

Operating Windows,Mac All operating systems where the browsers above can run.
System OS X, Linux

• Note: Selenium WebDriver is termed as the successor of Selenium RC which has been deprecated
& officially announced by SeleniumHQ.

How to Choose the Right Selenium Tool for Your Need

Tool Why Choose?

• To learn about concepts on automated testing and Selenium, including:

• Selenese commands such as type, open, clickAndWait, assert, verify, etc.

• Locators such as id, name, xpath, css selector, etc.

• Executing customized JavaScript code using runScript


Selenium IDE • Exporting test cases in various formats.

• To create tests with little or no prior knowledge in programming.

• To create simple test cases and test suites that you can export later to RC or
WebDriver.

• To test a web application against Firefox only.

• To design a test using a more expressive language than Selenese

• To run your test against different browsers (except HtmlUnit) on different


operating systems.
Selenium RC

• To deploy your tests across multiple environments using Selenium Grid.


SOFTWARE TESTING

Tool Why Choose?

• To test your application against a new browser that supports JavaScript.

• To test web applications with complex AJAX-based scenarios.

• To use a certain programming language in designing your test case.

• To test applications that are rich in AJAX-based functionalities.


WebDriver
• To execute tests on the HtmlUnit browser.

• To create customized test results.

• To run your Selenium RC scripts in multiple browsers and operating systems


simultaneously.
Selenium Grid
• To run a huge test suite, that needs to complete in the soonest time possible.

Advantages of Selenium

i) It is an Open source Software.

ii) It supports various Operating environments (Windows, Linux, Mac etc…)

iii) It supports various browsers (IE, Mozilla Firefox, Chrome, safari, Opera etc…)

iv) It supports various programming environments (Java, Perl, Python, Ruby and PHP)

v) It supports parallel Test execution.

vi) It uses less Hardware resources.

Disadvantages of Selenium
i) It supports Web based Applications only.

ii) No reliable support from anybody.

iii) No centralized maintenance of Elements/objects

iv) Difficult to setup environment.

v) Difficult to use.

vi) Limited support for Image based testing.

vii) New features may not work properly.

viii) No other tool integration for test management & No built in Reporting facility.
SOFTWARE TESTING

SeleniumVersus UFT

Selenium UFT / QTP

1) Open Source Vendor tool, License is required.

2) Supports various OS Environments. MS Windows only.

3) Supports various Programming Environments VBScript only.

4) No Object Repositories Local and Shared object Repositories.

5) No built-in Reporting feature. Built-in reporting feature.

6) Selenium WebDriver has no IDE and Selenium UFT has both IDE and Programming
IDE has no Programming Interface. Interface.

7) Uses less Hardware resources. Uses more Hardware resources

8) Difficult to setup environment and use. Easy to setup and use.

9) Limited support for Image Testing Rich support for Image Testing

10) No Reliable support Support from HP

11) No other tool integration for Test UFT can be integrated with ALM/QC for Test
management. Management.

12) New features may not work properly. New features will properly.

13) No Add ins for supporting Application Add ins are required for supporting
Environments. Application environments.

14) Supports Web Applications only Supports Desktop and Web Applications.

15) No Authorized Certification Authorized Certification program.

What is TestNG?
TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time
before TestNG came into existence. NG stands for 'Next Generation'.

TestNG framework provides the following features −

• Annotations help us organize the tests easily.


• Flexible test configuration.
• Test cases can be grouped more easily.
• Parallelization of tests can be achieved using TestNG.
• Support for data-driven testing.
• Inbuilt reporting.
SOFTWARE TESTING

Step by Step Tutorial

1. First of Download Latest Eclipse java photon-R version.


2. Download latest selenium-server-standalone-3.13.0 jar File from following link
https://www.seleniumhq.org/download/ here on site 3.14.0 version is latest

3. Download and Extract Chromedriver.exefor windows on any drive of computer.


http://chromedriver.chromium.org/downloadshere 2.42 is latest version
SOFTWARE TESTING

4. After Download Extract same on any Drive here I m extract on D Drive and my path of that exe
file is D:\my document\Download\chromedriver_win32

5. Now Open Eclipse IDE-----> Create Java Project-→ Right Click Project Name→Properties→
Java Build Path→Libraries→Add External JAR→ add selenium-server-standalone-3.13.0 jar
→Apply and Close.
SOFTWARE TESTING

6. Now Want Open the chrome browser with facebook.com page via Selenium Web driver Java
Coding so here we need to write Java Code in Class file which we already created
7. Here in My Program I Create Ghanshyam_Selenium Java Project Folder name and
Opensite.java is my class file so write java code in this class file
SOFTWARE TESTING

8. Right click on java program, select Run As and > "Java Application". After Code Successfully
Run now see the output in Console Prompt

9. Now Your browser Open Automatically it shown data;


10. one more message display chrome is being controlled by Automated Test Software
It mean we open chrome browser and facebook.com page by selenium web driver java code
Successfully.

In this way Our First Module Run Successfully.


SOFTWARE TESTING

Module-2 In This Project I want to collect all Rating Feedback related our college
available on website Justdial.com
1. Create One Java Project Folder Give Name→Review Demo→Now Create One Class File give name
Practo.com
2. Right Click Project Name→Properties→ Java Build Path→Libraries→Add External JAR→ add
selenium-server-standalone-3.13.0 jar →Apply and Close.
3. Similarly Copy the Chromedriver.exe file on my D Drive D:/soft/chromedriver.exe in this way.
4. Now Start right writing code for Practo.java to Collect all review of any Hospital.
Here I want search all feedback of SNJB-s-Late-Sau-Kantabai-Bhavarlalji-Jain-College-Of-
Engineering-Neminagar-Chandwad
Link of Feedback of All Customer-
https://www.justdial.com/Nashik/SNJB-s-Late-Sau-Kantabai-Bhavarlalji-Jain-College-Of-
Engineering-Neminagar-Chandwad/0253PX253-X253-151019113056-B2P9_BZDET/reviews/page-6
5. Now to save Feedback of all pages here I create one text file give
name C:\Users\admin\eclipse-
workspace\SeleniumProject\ReviewProj\Snjb.txt
Now First of All Execute Code here my file name Mouthshut.java
Mouthshut.com is website like Justdialcom

After Execution Code Mouthshut.java Chrome Browser Opened Automatically with Specified
website you can also see the output of rating in console as well as file you created.
SOFTWARE TESTING

Now Lets Check the Feedback of All Customer go to your Eclipse Workspace Path my path is
C:\Users\admin\eclipse-workspace\SeleniumProject\ReviewProj\Snjb.txt

After Open Txt File See the Output


SOFTWARE TESTING

In This you can Collect all different kind of colleges, hospital rating and review from various website like
mouthshout.com,Justdial.com via Selenium Web driver Tool

Module-3 Now I want Collect Review of Aditya-Birla-Memorial-Hospital-Chinchwad-


Pune

Link- https://www.mouthshut.com/product-reviews/Aditya-Birla-Memorial-Hospital-
Chchwad-Pune-reviews-925602748-page-2

After Execution of Code-


SOFTWARE TESTING

Selenium IDE:
1. Download Selenium IDE Chrome Extension from following Link
https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd?hl=en
2. Click on Add to Chrome
3. Check the icon on of IDE Square in right side after browser after successfully installation to
chrome
4. Now Click on record button do some operation on website…see the report in console of IDE
command target and value….in this way you also find out xpath etc information.
SOFTWARE TESTING

You can also check the Automated Test Case Pass or Fails see the following figure
SOFTWARE TESTING

CONCLUSION
In this way you learn how to use Selenium Open Source Tool for perform Automation Testing on web
based application.

Selenium is used to automate testing across several web browsers, including Chrome, Mozilla, Firefox,
Safari, and Internet Explorer.

Pros of Selenium include its popularity, support for various systems, browsers, and languages,
integration with CI/CD platforms, and the ability to test mobile devices
SOFTWARE TESTING

REFERENCE

“The Complete Guide to Software Testing – Second Edition,” Hetzel, B., QED Information Sciences Inc.,
Massachusetts, 1988. ISBN: 0-89435-242-3.Google Scholar

“The Art of Software Testing,” Myers, G. J., Wiley, John, New York, 1979.Google Scholar “PRINCE 2:
Project Management for Business,” 4th edition, CCTA, 1996. ISBN: 0-11-330685-7.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy