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

Selenium

Selenium is an open-source automation tool for testing web applications across various browsers and platforms, enabling user interaction simulation. It consists of components like Selenium IDE for recording interactions, Selenium RC (now deprecated) for browser control, and Selenium WebDriver for efficient automation. Additionally, Selenium Grid allows parallel execution of tests across different machines and browsers, enhancing cross-browser testing capabilities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Selenium

Selenium is an open-source automation tool for testing web applications across various browsers and platforms, enabling user interaction simulation. It consists of components like Selenium IDE for recording interactions, Selenium RC (now deprecated) for browser control, and Selenium WebDriver for efficient automation. Additionally, Selenium Grid allows parallel execution of tests across different machines and browsers, enhancing cross-browser testing capabilities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SELENIUM

SELENIUM
Selenium is a free, open-source automation tool used for
testing web applications across different browsers and
platforms.

It allows testers and developers to simulate user interactions


with web pages like clicking buttons, filling forms, navigating
between pages, and more — just like a real user would.
•Automates browser tasks for testing
•Supports multiple languages (Python, Java, C#, etc.)
•Works on all major browsers (Chrome, Firefox, Edge)
•Used in manual and automated testing environments
Selenium
Components
Selenium IDE (Integrated Development
Environment)
Selenium IDE is a browser plugin (available for
Chrome and Firefox) that allows users to record,
edit, and replay browser interactions. It’s mainly
used for learning, prototyping, and creating simple
•Offers a GUI for recording user interactions.
test cases.
•Automatically generates test scripts in Selenese (Selenium's
command language).
•Limited to basic functionality and specific browsers.
Selenium RC(Remote Control)
Selenium RC (Remote Control) is an older component of the
Selenium suite that allowed test automation for web applications
using any programming language by using a server to control
browser interactions.
Note: Selenium RC is now deprecated and has been replaced by
Selenium WebDriver, which is more efficient and powerful.
• Uses a Selenium Server to interact with browsers
• Supports multiple programming languages (Java, Python, C#, Ruby, PHP, etc.)
• Enables cross-browser testing
• Supports automated functional and regression testing
Selenium RC Architecture

In Selenium RC, there is a manual process called


Selenium Server. It is mandatory to start before
execution and stop after the execution, which acts as
a middleman between the code and the browser.

The commands (API’s) are sent to the Server. It


interprets the command and converts it into
JavaScript and then JavaScript is injected to the
browser. Now the browser executes the JavaScript
and responds to a server, which again interprets the
command and returns to code in the respective
language.
Selenium Webdriver
 Selenium WebDriver is the successor of Selenium RC (Remote Control), which has been
officially deprecated. Selenium WebDriver accepts commands using the JSON-Wire
protocol (also called Client API) and sends them to a browser launched by the specific driver
class (such as ChromeDriver, FirefoxDriver, or IEDriver).
 Selenium WebDriver is a powerful component of the
Selenium suite that allows you to automate web browser
interactions using code. It directly communicates with the
browser without needing any intermediary, making it faster,
more efficient, and capable of handling dynamic web
•Supports testing on headless browsers and mobile devices.
•elements.
Directly controls the browser using its native support.
•Supports multiple programming languages: Java, Python, C#, Ruby, etc.
•Works across multiple browsers: Chrome, Firefox, Edge, Safari, etc.
•Can handle dynamic content, alerts, pop-ups, and dropdowns.
1.The driver listens to the commands from Selenium
2.It converts these commands into the browser's native API
3.The driver takes the result of native commands and sends the result back to
Selenium

8
Selenium Grid
 Selenium Grid is a part of the Selenium Suite used to run
test cases on different machines, browsers, and operating
systems at the same time (parallel execution).
 It helps perform cross-browser testing and distributed
testing efficiently.
 We can create a Selenium Grid, where one server runs as the Hub, managing a
pool of Nodes.
1.You write a test script and send it to the hub.
2.The hub checks which node matches the required browser and
For example:
OS.
Firefox on Linux
3.The
Safari ontest is executed on that node, and results are sent back.
macOS
Chrome on Windows
Selenium Grid allows you to test on all of them simultaneously without switching systems.
Web Elements
 Web elements are the basic building blocks of a web page. They
include both visible elements (like text, images, and buttons)
and invisible elements (like forms and metadata).
For example:
<html>
<body>
<form id="loginForm">
<label>Enter Username: </label>
<input type="text" name="Username"/>
<label>Enter Password: </label>
<input type="password" name="Password"/>
<input type="submit"/>
</form>
<a href="forgotPassword.html">Forgot Password ?</a>
</body>
</html>
Web Elements
rm>: The form element that collects the username and password.
bel>: Defines text labels for the input fields.
put type="text">: For entering the username.
put type="password">: For entering the password (it hides the input).
put type="submit">: A button to submit the form.
>: A hyperlink to the forgot password page.

Let’s say you want to automate a login process using Selenium:


•Step 1: Locate the username and password fields using their attributes like
name or id.
•Step 2: Enter text into these fields using send_keys().
•Step 3: Locate the submit button and click it using click().
Thank You!

You might also like