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

Selenium.docx

selenium installation
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)
18 views

Selenium.docx

selenium installation
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/ 8

Program -8

AIM: Study of Selenium IDE(open source testing tool)


EX: To test web-based applications that could be run in an Internet browser i.e. to record
how an application is being used and then play back those recordings followed by asserts.
THEORY:
● Selenium is a FUNCTIONAL testing tool.
● Selenium is set of different software tools each with a different approach to
supporting test automation.
● The entire suite of tools results in a rich set of testing functions specifically to fulfill
the needs of testing of web applications of all types. These operations are highly
flexible, allowing many options for locating UI elements and comparing expected test
results against actual application behaviour.
● One of Selenium’s key features is the support for executing one’s tests on multiple
browser platforms.
Introduction:
● Selenium IDE (Integrated Development Environment) is a prototyping tool for
building test scripts. It is a Firefox plug-in and provides an easy-to-use interface for
developing automated tests. Selenium IDE has a recording feature, which records
user actions as they are performed and then exports them as a reusable script in one
of many programming languages that can be later executed.
● It is open source software released under the apache 2.0 license.
a) Selenium’s Tool Suite: Selenium is composed of multiple software tools. Each
has a specific role.
b) Selenium IDE :( Selenium Recorder)
● Selenium IDE is a complete Integrated Development Environment for Selenium tests
which is a extension for Firefox and allows recording, editing and debugging tests. It
is prototyping tool.
Features:
● Record and playback
● Intelligent field selection will use IDs, names as needed
● Auto complete for all common Selenium commands
● Debug and set breakpoints
● Save tests as HTML , Ruby scripts or other scripts
● Support for Selenium user-extensions.js file
● Option to automatically assert the title of every page
Selenium Remote Control: (Selenium 1): It is a server, written in java , that accepts
commands for the browser via HTTP. RC makes it possible to write automated tests for a
web application in any programming language, which allows for better integration of
Selenium in existing unit test frameworks.
Selenium 2 :( Selenium Webdriver): Selenium 2 is the newest addition in the Selenium
toolkit. In includes a more cohesive and object oriented API. It supports backwards
compatibility with Selenium 1’s and Selenium RC interface.
Selenium-Grid:Selenium Grid allows you to run your tests in parallel, that is, different
tests can be run at the same time on different remote machines.

Steps to Install:
Using Firefox, first, download the IDE from the SeleniumHQ downloads page. Firefox will
protect you from installing add-ons from unfamiliar locations, so you will need to click
‘Allow’ to proceed with the installation, as shown in the following screenshot.

When downloading from Firefox, the following window opens

Select Install Now. The Firefox Add-ons window pops up, first showing a progress bar, and
when the download is complete, displays the following.
Restart Firefox. After Firefox reboots you will find the Selenium-IDE listed under the Firefox
Tools menu.

Selenium IDE Features:


b) Toolbar: The toolbar contains buttons for controlling the execution of your test
cases, including a step feature for debugging your test cases

Speed Control: controls how fast your test case runs.

Run All: Runs the entire test suite when a test suite with multiple test cases is loaded.

Run: Runs the currently selected test. When only a single test is loaded this button
and the Run All button have the same effect.

Pause/Resume: Allows stopping and re-starting of a running test case.


Step: Allows you to “step” through a test case by running it one command at a time.
Use for debugging test cases.

Test Runner Mode: Allows you to run the test case in a browser loaded with the
Selenium-Core TestRunner. The TestRunner is not commonly used now and is likely to
be deprecated. This button is for evaluating test cases for backwards compatibility
with the TestRunner. Most users will probably not need this button.

Apply Rollup Rules: This advanced feature allows repetitive sequences of Selenium
commands to be grouped into a single action. Detailed documentation on rollup
rules can be found in the UI-Element Documentation on the Help menu.

Record: Records the user’s browser action


c) Test Case Pane:
The script is displayed in the test case pane.

It has two tabs, one for displaying the command and their parameters in a readable “table”
format.
The Command, Target, and Value entry fields display the currently selected command along
with its parameters. These are entry fields where the modifications to the currently selected
command can be done.
The first parameter specified for a command in the Reference tab of the bottom pane always
goes in the Target field. If a second parameter is specified by the Reference tab, it always
goes in the Value field.

d) Log/Reference/UI-Element/Rollup Pane:
The bottom pane is used for four different functions–Log, Reference, UI-Element, and
Rollup–depending on which tab is selected.
Log: When running the test case, error messages and information messages showing the
progress are displayed in this pane automatically. These messages are often useful for test
case debugging.
Reference: The Reference tab is the default selection for entering or modifying Selenese
commands and parameters in Table mode.

e) Selenium Commands – “Selenese”


Selenium provides a rich set of commands for fully testing your web-app in virtually any way
you can imagine. The command set is often called selenese. These commands essentially
create a testing language.
A command is what tells Selenium what to do. Selenium commands come in three “flavors”:
Actions, Accessors and Assertions.
Actions are commands that generally manipulate the state of the application.
Many Actions can be called with the “AndWait” suffix, e.g. “clickAndWait”. This
suffix tells Selenium that the action will cause the browser to make a call to the
server, and that Selenium should wait for a new page to load.
Accessors examine the state of the application and store the results in variables,
e.g. “storeTitle”. They are also used to automatically generate Assertions.
Assertions are like Accessors, but they verify that the state of the application
conforms to what is expected. Examples include “make sure the page title is X”
and “verify that this checkbox is checked”.
Commonly Used Selenium Commands
1) Open: opens a page using a URL.
2) Click/clickAndWait: performs a click operation, and optionally waits for a new page to
load.
3) VerifyTitle/assert Title: verifies an expected page title.
4) VerifyTextPresent: verifies expected text is somewhere on the page.
5) VerifyElementPresent: verifies an expected UI element, as defined by its HTML tag, is
present on the page.
6) VerifyText: verifies expected text and its corresponding HTML tag are present on the
page.
7) VerifyTable: verifies a table’s expected contents.
8) WaitForPageToLoad: pauses execution until an expected new page loads. Called
automatically when clickAndWait is used.
Program: 8.1
Step 1: Open the selenium IDE from the Mozilla browser

Step 2: Hit the Record Button in selenium IDE.


Step 3:Open the browser in a new tab and open the zomato web page.

All the action performed will be displayed on the screen

Step 4: now save the test case as “zomato1”


Step 5: Run the test case by opening the zomato case and click on

Step 6: Finally, all operations are performed in browser.

Results:
Selenium is highly flexible. We can add functionality to both Selenium test scripts and
Selenium’s framework to customize your test automation. Since Selenium is Open Source,
the source code can always be downloaded and modified.

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