Selenium Beyond The Nitty Gritty of Programming Languages
PallaviSharma617656
184 views
37 slides
Aug 30, 2024
Slide 1 of 37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
About This Presentation
This presentation talks about Selenium as a standard for web browser automation. It was first presented at the Lambda TestMu Conference 20204.
Size: 2.66 MB
Language: en
Added: Aug 30, 2024
Slides: 37 pages
Slide Content
Selenium Beyond the Nitty Gritty of
Programming Language
Pallavi Sharma
Founder
5 Elements Learning
&
Mosaic Words
•Pallavi Sharma
•Founder
•5 Elements Learnings
•Mosaic Words
•Professional Experience -18 years+
•Committer at Selenium Project
•Published Author – 4 Technical Books
on Selenium
•Google WTM Ambassdor
Scan QR Code
https://linktr.ee/musepallavi
▪What is Selenium [5]
▪Selenium components [5]
▪Basics of Web Browser Automaton
[10]
▪Exploring Selenium Client Bindings [5]
▪Ecosystem based on Programming
Language [5]
▪Frameworks available on Selenium
per Programming Language [5]
▪Questions /Discussions[10]
src- https://www.runmode.com/automationhumor.html
Selenium automates web
browsers, that’s it.
How we use that power its
entirely up to us!
What is
Selenium?
https://www.selenium.dev/
So What is Selenium?
▪Selenium is an umbrella project for various tools and libraries
that enable automation of browser.
▪It remotely controls browser instances and emulates user
interaction with the browser.
▪Selenium at its core is a browser user agent library, which
means that it is a type of software responsible for retrieving
and facilitating end user interaction with web content.
▪The main guiding principle of Selenium project is to support
common interface for all major Web Browsers.
▪It is able to achieve it with help of WebDriver standard,
which is a work in progress W3C standard.
https://www.w3.org/WAI/UA/work/wiki/Definition_of_User_Agent
Important Links
▪The WebDriver working draft is available here
– https://www.w3.org/TR/webdriver2/
▪The WebDriver BiDi-
https://w3c.github.io/webdriver-bidi/
▪Knowing about the Browser Testing and Tools
Working group can further help-
https://www.w3.org/groups/wg/browser-tools-
testing/
Selenium Project
Selenium IDE
For Record and
Playback of
scripts
Selenium WebDriver
Create robust,
browsed based
automation
Selenium Grid
Scale by
distributing on
different
machines
Features of Selenium
Support Multiple
Browsers
Support Multiple
Programming
Language
Support
Multiple
Operating
System
So What is
Selenium
A browser automation library based
on the WebDriver standard and is
driving WebDriver-BiDi standard
with other browser vendors and
tools.
Selenium Project-
https://github.com/orgs/SeleniumHQ
/repositories?type=all
Selenium
Open
source
project
Browser
automation
library
Standard
for web
browser
automation-
WebDriver
Tool to run
browser –
local/remote
Tool to run
browsers in
parallel
A group
working on
the next
WebDriver
Bi-Di
standard
Basics of Web
Browser Automation
To understand basics of web browser
automation, we need to understand
first the following-
▪What is a Web Browser
▪What is a Web Application
▪What is WebDriver
▪What are client-bindings
▪What is a Web Page
▪HTML
▪Demo Application
Basics of Web
Browser
•A Web Browser is a software application, which allows us to
explore the World Wide Web. It acts as an interface between
the web server and the end user.
•The information is shared over the HTTP protocol, and the
HTML page is rendered on the browser for the client to view.
•For seamless experience of the Web on any device through a
browser, it is important that browsers are based on web
standards defined by W3C.
•Browsers like Chrome, Mozilla, Edge, Opera, Safari are
based on it.
•More on standards for browsers can be found here -
https://developer.mozilla.org/en-
US/docs/Learn/Getting_started_with_the_web/The_web_and
_web_standards
•To understand working of browser-
https://developer.chrome.com/blog/inside-browser-part1
Basics of Web Driver
“taken as it is from W3-”
WebDriver is a remote-control interface that enables
introspection and control of user agents. It provides a
platform-and language-neutral wire protocol as a
way for out-of-process programs to remotely instruct
the behavior of web browsers.
WebDriver is programmatically an interface and
protocol which allows us to control and interact with
the web browser. They are responsible for controlling
the actual browser.
Drivers are created by the browser vendors
themselves and run with browser itself.
Web
Driver
Chrome
Driver
Chrome
Firefox
Driver
Firefox
Edge
Driver
Edge
Safari
Driver
Safari
Opera
Driver
Opera
https://www.w3.org/TR/webdriver2/
What are Client Bindings
•The term "Selenium client binding" refers to
the libraries or APIs provided by Selenium to
support different programming languages.
•These bindings allow developers to write
Selenium scripts in the programming
language of their choice.
•Each of these bindings provides a set of
classes and methods that you can use to
interact the browser and its elements for your
work.
Example Client Binding - Java
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/WebDriv er. html
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/WebDriv er. html
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/WebElement. html
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/WebElement. html
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/By . html
https: //www. selenium. dev /selenium/docs/a pi/ja v a /org /openqa /selenium/By . html
https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium
/WebDriver.html
WebDriver
https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium
/WebElement.html
Web Element
https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium
/By.html
By
Basics of Web Application
•A web application is an application program which is stored on the
remote server and delivered over the internet to the user browser
interface.
•The browser could be on any device, the experience of the web
application should remain same across any browser used to access
the app, if the browser is following web standards, and the application
is created keeping it in mind.
•Some of the tools which can help you confirm this -
https://www.w3.org/developers/tools/
•Understand web standards- https://www.w3.org/standards/
•Understanding html5- https://html.spec.whatwg.org/multipage/
Basic of Web Page
•A Web Page is a document which is
written in HTML, and can include text,
media and scripts. It is accessed using
a web browser. A Web Page is part of a
web application.
•A Collection of web pages makes a web
application.
•We will now to understand further
concepts use an application -
https://5elementslearning.dev/demosite/
Basics of HTML
HTML is a markup language that defines the structure and content of
the page. It is used by the web browser to render the web page for end
user. A good link to understand HTML is -
https://www.w3schools.com/html/html_intro.asp
HTML page consists of HTML Elements. An HTML Element has
▪ an opening tag
▪ a closing tag
▪ attributes
Sample HTML Page
Web Application Automation- Page/Scenario Level
Web Page/Scenario
Automation
Creation
Browser
Manageme
nt
Element
Identificatio
n
Action on
Elements
Verify
Execution
Local Grid
Lab Cloud Vendor
Sample Script Work Flow
Problem
Statement
Outline of
Scenario
Launch
browser with
application
url
Perform
actions on
the elements
of the page/s.
Execute
Script
Close
browser
Define Problem
Statement
•Launch the Chrome Browser with
Application URL
https://5elementslearning.dev/demos
ite/
•Click on My Account link
•Close the browser
Test Automation
Components
Test Automation
Components
Unit testing
tool
Synchronization
Parameterization
Reports and
Logs
Object
Management
Architecture
for Modular
and Scalable
and
Maintainable
Code