Selenium Beyond The Nitty Gritty of Programming Languages

PallaviSharma617656 184 views 37 slides Aug 30, 2024
Slide 1
Slide 1 of 37
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
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.


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.

Selenium Client Bindings-APIs
•https://www.selenium.dev/selenium/docs/api/java/index.htmlJava
•https://www.selenium.dev/selenium/docs/api/dotnet/C Sharp
•https://www.selenium.dev/selenium/docs/api/py/Python
•https://www.selenium.dev/selenium/docs/api/rb/Ruby
•https://www.selenium.dev/selenium/docs/api/javascript/inde
x.html
JavaScript

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

https://www.selenium.dev/documentation/overview/components/

Plant a Tree ☺

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

Basic Automation Script
https://github.com/pallavigitwork/TestM
uConf2024Pallavi.git

Test Automation
Components
Test Automation
Components
Unit testing
tool
Synchronization
Parameterization
Reports and
Logs
Object
Management
Architecture
for Modular
and Scalable
and
Maintainable
Code

https://www.cleanpng.com/png-computer-software-test-automation-software-testing-757130/download-png.html

Ecosystem for Testing with Selenium
Selenium
Java
Eclipse/Inte
lliJ
Junit/TestNG
Maven/Gradle
Python
PyCharm/Eclipse
pytest/unitt
est
bazel
CSharp
Visual
Studio
MSTest/Nunit
NuGet
Ruby
RubyMine
Rspec/MiniTe
st
bazel
Javascript
Visual
Studio
Code
Jest/Mocha
bazel
https://www.selenium.dev/documentation/webdriver/getting_started/using_selenium/

Frameworks over Selenium
Selenium
Java
Selenide
SHAFT
Python
Robot
Framework
Selenium
Base
Nerodia
CSharp
Atata
Yapoml
Ruby
Watir
Capybara
Javascript
NightWatch
WebDriverIO
https://www.selenium.dev/ecosystem/

Selenium Governance
Selenium
PLC TLC Committers
Core Selenium Website and Docs Translators Docker
Users Sponsors Volunteers
https://www.selenium.dev/project/governance/

Contribute To
Selenium