Ste Final
Ste Final
SELENIUM
What is Selenium?
Selenium is a free (open source) automated testing suite for web applications across different browsers
and platforms.
• 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.
✓ Linux
✓ Macintosh etc…
✓ IE
✓ Google Chrome
✓ Safari
✓ Opera etc…
✓ C#
✓ Python
✓ Perl
✓ Ruby
✓ PHP
• 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
It is a Firefox browser plug in, used to create and execute Test cases.
2. Selenium RC (* Out dated) -Currently, Selenium RC is still being developed but only in
maintenance mode.
• Selenium WebDriver
✓ 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
✓ MS Windows
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:
• Because of their architectural differences, Selenium IDE, Selenium RC, and WebDriver support
different sets of browsers and operating environments.
Selenium
IDE WebDriver
Selenium
IDE WebDriver
iOS 3+ for phones (devices & emulators) and 3.2+ for tablets (devices &
emulators)
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.
• To create simple test cases and test suites that you can export later to RC or
WebDriver.
Advantages of Selenium
iii) It supports various browsers (IE, Mozilla Firefox, Chrome, safari, Opera etc…)
iv) It supports various programming environments (Java, Perl, Python, Ruby and PHP)
Disadvantages of Selenium
i) It supports Web based Applications only.
v) Difficult to use.
viii) No other tool integration for test management & No built in Reporting facility.
SOFTWARE TESTING
SeleniumVersus UFT
6) Selenium WebDriver has no IDE and Selenium UFT has both IDE and Programming
IDE has no Programming Interface. Interface.
9) Limited support for Image Testing Rich support for Image Testing
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.
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'.
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
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
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
Link- https://www.mouthshut.com/product-reviews/Aditya-Birla-Memorial-Hospital-
Chchwad-Pune-reviews-925602748-page-2
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.