SlideShare a Scribd company logo
SELENIUM 4.0 GRID OBSERVABILITY
LAB
#ATAGTR2021 DAY 2 12TH DECEMBER 2021
Aditya Garg
MY SOCIAL MEDIA HANDLES
https://twitter.com/adigindia
https://www.linkedin.com/in/adigarg/
WHAT WILL BE
COVERED
1. Selenium Grid and importance of traceability in Distributed architecture
2. Understanding Observability components in Selenium 4.0 and installing
coursier
3. Setting up a GCP machine with docker
4. Opening up necessary ports
5. Running Jaeger on the GCP machine
6. Setting up traceability in SeleniumGrid 4.0
7. Executing the tests and observing the trace
Have you worked on Java and Selenium before (yes or no)
ⓘ Start presenting to display the poll results on this slide.
Have you worked in Selenium Grid before
ⓘ Start presenting to display the poll results on this slide.
MORE QUESTIONS
1. How many of you would be participating in this Lab with me ?
2. Do you have your laptops ready ?
3. Do you have the following installed
1. JDK 1.8
2. Maven
4. Do you have PowerShell installed ?
5. Do you have your account with GCP ?
CHECKS CONTINUED
1. Double check on few things
Follow along with me
1. Java check
2. Maven check
3. Selenium 4.0 latest Jar
4. Powershell check
5. GCP account
https://docs.microsoft.com/en-
us/powershell/scripting/install/installing-powershell-on-
windows?view=powershell-7.2#msi
https://www.selenium.dev/downloads/
https://ataevents.online/LabGuideATAGTR2021
SELENIUM GRID AND IMPORTANCE OF
TRACEABILITY/OBSERVABILITY IN
DISTRIBUTED ARCHITECTURE
Grid
3.X
1. Multiple nodes
Ref: https://www.lambdatest.com/blog/selenium-grid-4-tutorial-for-distributed-testing/
Grid
4.0
Ref: https://www.browserstack.com/guide/selenium-grid-4-tutorial
What
can
go
wrong
Any of the process Any of the nodes
• Imagine running your tests
on a fully distributed
architecture and things are
not going as planned.
• How do you trace or observe
your request going through
multiple processes and
running on a node (specially
if things are not working as
planned)
This is where observability comes in
We can trace every request in a time series manner
OpenTelemetry
Grid 4.0 is special in more than
many ways
1. It is designed to work with
modern infrastructures like
docker and Kubernetes
2. The code is by default
instrumented with
OpenTelemetry
OpenTelemetry 1. Telemetry Data such as
traces, metrics and logs
2. Popular Opensource
Backends (which help
us analyze or use this
data)
a. Jaeger
b. Prometheus
Grid
4.0
is
fully
observable Grid 4.0 is special in more than
many ways
1. It is designed to work with
modern infrastructures like
docker and Kubernetes
2. The code is by default
instrumented with
OpenTelemetry
This is where the entire request responses telemetry data ((metrics, logs, and traces) can be
instrumented, collected, and exported to help us analyze our Grid’s performance and behavior.
Selenium 4 Grid is thus fully observable – it helps us troubleshoot issues, optimize performance, and
provide visibility into the system
Selenium
Grid
4
Observability
components
1
Open Telemetry which is instrumented in the
Selenium 4.0 Jar files or code itself.
• This helps in tracing every requests lifecycle
• Trace contains details about the information called as spans
• Span records time logs – called as events
• All these are nothing but some form of logs – which we were
already used to see on a command prompt.
• This can be configured easily to send all the data to a backend
data consolidator – Jaeger
Selenium
Grid
4
Observability
components
• Since Console logs becomes too tedious to query and analyze
• We need a mechanism for visualizing and querying traces
• Jaeger seamlessly integrates with OpenTelemetry to provide a
rich experience of querying, visualizing and collecting request
traces
https://www.jaegertracing.io/
2
The second player in the Selenium 4.0
Observability is Jaeger
LET US GET INTO SOME ACTION
1
2
3
Using Selenium 4.0 Jar
Installing coursier – which is used for updating the classpath for tracer (open telemetery)
Running Jaeger
We can install using binaries or run docker through docker images
Selenium
Grid
4
Observability
Setup
java -jar selenium-server-4.1.0.jar info tracing
This example uses a tool called "coursier" to generate a full classpath, but
you can also write this manually. When started this way, the selenium
server will inform you that it has found a tracer on stdout.
1
Selenium
Grid
4
Observability
Setup
2
Installing coursier – which is used for updating the
classpath for tracer (open telemetery)
https://get-coursier.io/docs/overview#coursier
https://get-coursier.io/docs/cli-installation
Selenium
Grid
4
Observability
Setup
Selenium
Grid
4
Observability
Setup
3
Running Jaeger
We can install using binaries or run docker through docker images
https://www.jaegertracing.io/
docker run -d --name jaeger -p 16686:16686 -p 14250:14250
jaegertracing/all-in-one:latest
Selenium
Grid
4
Observability
Setup
Do you have docker installed on your machine ?
Selenium
Grid
4
Observability
Setup
https://console.cloud.google.com
1. We will create a VM with pre-
installed docker
2. Open required ports
3. Install and run Jaeger
4. If you already have docker installed,
you do not need these steps.
Docker Engine Community on Ubuntu 18.04 LTS
Selenium
Grid
4
Observability
Setup docker run -d --name jaeger -p 16686:16686 -p 14250:14250
jaegertracing/all-in-one:latest
We will run our docker VM in a GCP
Open ports 16686 and also 14250 for our telemetry needs
Run the Jaeger image
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
0.0.0.0/0
Selenium
Grid
4
Observability
Setup
2 Running Jaeger
We can install using binaries or run docker through docker images
https://www.jaegertracing.io/
docker run -d --name jaeger -p 16686:16686 -p 14250:14250
jaegertracing/all-in-one:latest
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-event-bus" -jar
selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) event-bus
a
Start Event Bus – connect to Jaeger and enable opentelemetry using –
ext option using coursier
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-sessions" -jar
selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) sessions
b Start sessionMap – connect to Jaeger and enable opentelemetry
using –ext option using coursier
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-session-queue" -jar
selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) sessionqueue
c Start sessionQueue – connect to Jaeger and enable
opentelemetry using –ext option using coursier
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-distributor" -jar
selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) distributor --sessions http://localhost:5556 --sessionqueue
http://localhost:5559 --bind-bus false
d Start distributor – connect to Jaeger and enable opentelemetry
using –ext option using coursier
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-router" -jar selenium-
server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) router --sessions http://localhost:5556 --sessionqueue
http://localhost:5559 --distributor http://localhost:5553
e Start router – connect to Jaeger and enable opentelemetry using –
ext option using coursier
Selenium
Grid
4
Observability
Setup
3
Running Selenium Grid with OpenTelemetery Java extension classes
connected to the running instance of Jaeger
We will be running distributed grid
java -D"otel.traces.exporter=jaeger" -
D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" -
D"otel.resource.attributes=service.name=selenium-node" -jar selenium-
server-4.0.0-rc-2.jar --ext $(cs fetch -p
io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-
netty:1.35.0) node
f Start node – connect to Jaeger and enable opentelemetry using –
ext option using coursier
Selenium
Grid
4
Observability
Setup
Selenium
Grid
4
Observability
Setup
Selenium
Grid
4
Observability
Setup
4
Add the necessary telemetry dependencies in selenium client
and run the code
a Add telemetry related dependencies in POM file
https://gitlab.com/adigindia/atagtr2021selenium4observability
Selenium
Grid
4
Observability
Setup
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-jaeger</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.35.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-handler -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.68.Final</version>
</dependency>
a
Add telemetry
related
dependencies in
POM file
4
Add the necessary
telemetry dependencies in
selenium client and run the
code
Selenium
Grid
4
Observability
Setup
4
Add the necessary telemetry dependencies in selenium client and run
the code
b Add system properties in selenium client code
System.setProperty("otel.traces.exporter", "jaeger");
System.setProperty("otel.exporter.jaeger.endpoint",
"http://164.52.192.223:14250");
System.setProperty("otel.resource.attributes", "service.name=selenium-java-client");
ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName",
"chrome");
driver = new RemoteWebDriver(new URL(hubURL), capabilities);
String hubURL = "http://localhost:4444";
RUN THE CODE AND
OBSERVE
OBSERVE ON JAEGER
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
BRING NODE DOWN AND
OBSERVE ON JAEGER
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Key
references
1. https://www.selenium.dev/blog/2021/selenium-4-observability/
2. https://www.selenium.dev/documentation/webdriver/remote_webdriver/
3. https://github.com/manoj9788/tracing-selenium-grid
4. https://get-coursier.io/docs/cli-installation
5. https://www.ibm.com/docs/en/sdk-java-technology/7.1?topic=jjc-specifying-java-
options-system-properties-2
6. https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-
1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt
7. https://opentelemetry.io/docs/java/
8. https://www.lambdatest.com/blog/selenium-grid-4-tutorial-for-distributed-testing/
9. https://www.browserstack.com/guide/selenium-grid-4-tutorial
10.https://docs.docker.com/compose/environment-variables/
11.https://github.com/SeleniumHQ/docker-selenium
THANK YOU
https://twitter.com/adigindia
https://www.linkedin.com/in/adigarg/

More Related Content

What's hot (20)

PDF
SRE Demystified - 14 - SRE Practices overview
Dr Ganesh Iyer
 
PDF
SRE for Everyone: Making Tomorrow Better Than Today
Rundeck
 
PDF
Hisnul-Muslim (Fortress of the Muslim) - Arabic / Urdu
The Choice
 
PPTX
Serverless Architectures
SuraiyaHasan19004210
 
PDF
Publish-Subscribe Middlewares
home
 
PPTX
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 
PDF
Gitlab ci-cd
Dan MAGIER
 
PDF
The walking dead (65)
Azhroth B.S
 
PDF
Agile transformation 1.3
Krystian Kaczor
 
PDF
Are You a SOLID Coder?
Steve Green
 
PDF
Agile Transformation at Scale
ITSM Academy, Inc.
 
PDF
Resolving technical debt in software architecture
Carola Lilienthal
 
PPTX
Learn Hadoop Administration
Edureka!
 
PPTX
The Journey to DevSecOps
SeniorStoryteller
 
PDF
Montreal Scaled Agile Meetup SAFe vs DAD
Etienne Laverdière
 
PDF
Cynefin sensemaking framework and usage examples
LuxoftAgilePractice
 
PPTX
What is Site Reliability Engineering (SRE)
jeetendra mandal
 
PDF
Observability; a gentle introduction
Bram Vogelaar
 
PDF
PopcornFlow: Continuous Evolution Through Ultra-Rapid Experimentation
Claudio Perrone
 
SRE Demystified - 14 - SRE Practices overview
Dr Ganesh Iyer
 
SRE for Everyone: Making Tomorrow Better Than Today
Rundeck
 
Hisnul-Muslim (Fortress of the Muslim) - Arabic / Urdu
The Choice
 
Serverless Architectures
SuraiyaHasan19004210
 
Publish-Subscribe Middlewares
home
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 
Gitlab ci-cd
Dan MAGIER
 
The walking dead (65)
Azhroth B.S
 
Agile transformation 1.3
Krystian Kaczor
 
Are You a SOLID Coder?
Steve Green
 
Agile Transformation at Scale
ITSM Academy, Inc.
 
Resolving technical debt in software architecture
Carola Lilienthal
 
Learn Hadoop Administration
Edureka!
 
The Journey to DevSecOps
SeniorStoryteller
 
Montreal Scaled Agile Meetup SAFe vs DAD
Etienne Laverdière
 
Cynefin sensemaking framework and usage examples
LuxoftAgilePractice
 
What is Site Reliability Engineering (SRE)
jeetendra mandal
 
Observability; a gentle introduction
Bram Vogelaar
 
PopcornFlow: Continuous Evolution Through Ultra-Rapid Experimentation
Claudio Perrone
 

Similar to #ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab" (20)

PPTX
Session on Launching Selenium Grid and Running tests using docker compose and...
Agile Testing Alliance
 
PDF
Distributed Tracing
distributedtracing
 
DOC
New selenium rc
girichinna27
 
PDF
The Diabolical Developer's Guide to Surviving Java 9
jClarity
 
PDF
First steps with selenium rc
Dang Nguyen
 
PPTX
Distributed tracing 101
Itiel Shwartz
 
PDF
OpenShift for Java EE Developers
Markus Eisele
 
PDF
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
telestax
 
PDF
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Boni García
 
PDF
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
PDF
Developing Selenium tests with JUnit 5
Boni García
 
PPT
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
PPTX
Selenium Training in Chennai
Thecreating Experts
 
PDF
Toward dynamic analysis of obfuscated android malware
ZongXian Shen
 
PPTX
Opendaylight SDN Controller
Sumit Arora
 
PPTX
Selendroid in Action
Dominik Dary
 
PDF
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
camp_drupal_ua
 
ODP
Automated UI testing with Selenium
Yuriy Gerasimov
 
PDF
TestWorks Conf Scalable QA with docker - Maarten van den Ende and Adé Mochtar
Xebia Nederland BV
 
PDF
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Session on Launching Selenium Grid and Running tests using docker compose and...
Agile Testing Alliance
 
Distributed Tracing
distributedtracing
 
New selenium rc
girichinna27
 
The Diabolical Developer's Guide to Surviving Java 9
jClarity
 
First steps with selenium rc
Dang Nguyen
 
Distributed tracing 101
Itiel Shwartz
 
OpenShift for Java EE Developers
Markus Eisele
 
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
telestax
 
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Boni García
 
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
Developing Selenium tests with JUnit 5
Boni García
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
Selenium Training in Chennai
Thecreating Experts
 
Toward dynamic analysis of obfuscated android malware
ZongXian Shen
 
Opendaylight SDN Controller
Sumit Arora
 
Selendroid in Action
Dominik Dary
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Automated UI testing with Selenium
Yuriy Gerasimov
 
TestWorks Conf Scalable QA with docker - Maarten van den Ende and Adé Mochtar
Xebia Nederland BV
 
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Ad

More from Agile Testing Alliance (20)

PPTX
#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...
Agile Testing Alliance
 
PDF
#Interactive Session by Ajay Balamurugadas, "Where Are The Real Testers In T...
Agile Testing Alliance
 
PPTX
#Interactive Session by Jishnu Nambiar and Mayur Ovhal, "Monitoring Web Per...
Agile Testing Alliance
 
PDF
#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...
Agile Testing Alliance
 
PDF
#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...
Agile Testing Alliance
 
PPTX
#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.
Agile Testing Alliance
 
PPTX
#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...
Agile Testing Alliance
 
PPTX
#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...
Agile Testing Alliance
 
PDF
#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...
Agile Testing Alliance
 
PPTX
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
Agile Testing Alliance
 
PPTX
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
Agile Testing Alliance
 
PPTX
#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...
Agile Testing Alliance
 
PPTX
#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...
Agile Testing Alliance
 
PDF
#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...
Agile Testing Alliance
 
PPTX
#Interactive Session by Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...
Agile Testing Alliance
 
PDF
#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...
Agile Testing Alliance
 
PDF
#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.
Agile Testing Alliance
 
PPTX
#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...
Agile Testing Alliance
 
PDF
#Interactive Session by Aniket Diwakar Kadukar and Padimiti Vaidik Eswar Dat...
Agile Testing Alliance
 
PPTX
#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...
Agile Testing Alliance
 
#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...
Agile Testing Alliance
 
#Interactive Session by Ajay Balamurugadas, "Where Are The Real Testers In T...
Agile Testing Alliance
 
#Interactive Session by Jishnu Nambiar and Mayur Ovhal, "Monitoring Web Per...
Agile Testing Alliance
 
#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...
Agile Testing Alliance
 
#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...
Agile Testing Alliance
 
#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.
Agile Testing Alliance
 
#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...
Agile Testing Alliance
 
#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...
Agile Testing Alliance
 
#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...
Agile Testing Alliance
 
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
Agile Testing Alliance
 
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
Agile Testing Alliance
 
#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...
Agile Testing Alliance
 
#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...
Agile Testing Alliance
 
#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...
Agile Testing Alliance
 
#Interactive Session by Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...
Agile Testing Alliance
 
#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...
Agile Testing Alliance
 
#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.
Agile Testing Alliance
 
#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...
Agile Testing Alliance
 
#Interactive Session by Aniket Diwakar Kadukar and Padimiti Vaidik Eswar Dat...
Agile Testing Alliance
 
#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...
Agile Testing Alliance
 
Ad

Recently uploaded (20)

PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 

#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"

  • 1. SELENIUM 4.0 GRID OBSERVABILITY LAB #ATAGTR2021 DAY 2 12TH DECEMBER 2021 Aditya Garg
  • 2. MY SOCIAL MEDIA HANDLES https://twitter.com/adigindia https://www.linkedin.com/in/adigarg/
  • 3. WHAT WILL BE COVERED 1. Selenium Grid and importance of traceability in Distributed architecture 2. Understanding Observability components in Selenium 4.0 and installing coursier 3. Setting up a GCP machine with docker 4. Opening up necessary ports 5. Running Jaeger on the GCP machine 6. Setting up traceability in SeleniumGrid 4.0 7. Executing the tests and observing the trace
  • 4. Have you worked on Java and Selenium before (yes or no) ⓘ Start presenting to display the poll results on this slide.
  • 5. Have you worked in Selenium Grid before ⓘ Start presenting to display the poll results on this slide.
  • 6. MORE QUESTIONS 1. How many of you would be participating in this Lab with me ? 2. Do you have your laptops ready ? 3. Do you have the following installed 1. JDK 1.8 2. Maven 4. Do you have PowerShell installed ? 5. Do you have your account with GCP ?
  • 7. CHECKS CONTINUED 1. Double check on few things Follow along with me 1. Java check 2. Maven check 3. Selenium 4.0 latest Jar 4. Powershell check 5. GCP account https://docs.microsoft.com/en- us/powershell/scripting/install/installing-powershell-on- windows?view=powershell-7.2#msi https://www.selenium.dev/downloads/ https://ataevents.online/LabGuideATAGTR2021
  • 8. SELENIUM GRID AND IMPORTANCE OF TRACEABILITY/OBSERVABILITY IN DISTRIBUTED ARCHITECTURE
  • 9. Grid 3.X 1. Multiple nodes Ref: https://www.lambdatest.com/blog/selenium-grid-4-tutorial-for-distributed-testing/
  • 11. What can go wrong Any of the process Any of the nodes • Imagine running your tests on a fully distributed architecture and things are not going as planned. • How do you trace or observe your request going through multiple processes and running on a node (specially if things are not working as planned) This is where observability comes in We can trace every request in a time series manner
  • 12. OpenTelemetry Grid 4.0 is special in more than many ways 1. It is designed to work with modern infrastructures like docker and Kubernetes 2. The code is by default instrumented with OpenTelemetry
  • 13. OpenTelemetry 1. Telemetry Data such as traces, metrics and logs 2. Popular Opensource Backends (which help us analyze or use this data) a. Jaeger b. Prometheus
  • 14. Grid 4.0 is fully observable Grid 4.0 is special in more than many ways 1. It is designed to work with modern infrastructures like docker and Kubernetes 2. The code is by default instrumented with OpenTelemetry This is where the entire request responses telemetry data ((metrics, logs, and traces) can be instrumented, collected, and exported to help us analyze our Grid’s performance and behavior. Selenium 4 Grid is thus fully observable – it helps us troubleshoot issues, optimize performance, and provide visibility into the system
  • 15. Selenium Grid 4 Observability components 1 Open Telemetry which is instrumented in the Selenium 4.0 Jar files or code itself. • This helps in tracing every requests lifecycle • Trace contains details about the information called as spans • Span records time logs – called as events • All these are nothing but some form of logs – which we were already used to see on a command prompt. • This can be configured easily to send all the data to a backend data consolidator – Jaeger
  • 16. Selenium Grid 4 Observability components • Since Console logs becomes too tedious to query and analyze • We need a mechanism for visualizing and querying traces • Jaeger seamlessly integrates with OpenTelemetry to provide a rich experience of querying, visualizing and collecting request traces https://www.jaegertracing.io/ 2 The second player in the Selenium 4.0 Observability is Jaeger
  • 17. LET US GET INTO SOME ACTION 1 2 3 Using Selenium 4.0 Jar Installing coursier – which is used for updating the classpath for tracer (open telemetery) Running Jaeger We can install using binaries or run docker through docker images
  • 18. Selenium Grid 4 Observability Setup java -jar selenium-server-4.1.0.jar info tracing This example uses a tool called "coursier" to generate a full classpath, but you can also write this manually. When started this way, the selenium server will inform you that it has found a tracer on stdout. 1
  • 19. Selenium Grid 4 Observability Setup 2 Installing coursier – which is used for updating the classpath for tracer (open telemetery) https://get-coursier.io/docs/overview#coursier https://get-coursier.io/docs/cli-installation
  • 21. Selenium Grid 4 Observability Setup 3 Running Jaeger We can install using binaries or run docker through docker images https://www.jaegertracing.io/ docker run -d --name jaeger -p 16686:16686 -p 14250:14250 jaegertracing/all-in-one:latest
  • 22. Selenium Grid 4 Observability Setup Do you have docker installed on your machine ?
  • 23. Selenium Grid 4 Observability Setup https://console.cloud.google.com 1. We will create a VM with pre- installed docker 2. Open required ports 3. Install and run Jaeger 4. If you already have docker installed, you do not need these steps.
  • 24. Docker Engine Community on Ubuntu 18.04 LTS
  • 25. Selenium Grid 4 Observability Setup docker run -d --name jaeger -p 16686:16686 -p 14250:14250 jaegertracing/all-in-one:latest We will run our docker VM in a GCP Open ports 16686 and also 14250 for our telemetry needs Run the Jaeger image
  • 28. Selenium Grid 4 Observability Setup 2 Running Jaeger We can install using binaries or run docker through docker images https://www.jaegertracing.io/ docker run -d --name jaeger -p 16686:16686 -p 14250:14250 jaegertracing/all-in-one:latest
  • 29. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid
  • 30. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-event-bus" -jar selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) event-bus a Start Event Bus – connect to Jaeger and enable opentelemetry using – ext option using coursier
  • 31. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-sessions" -jar selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) sessions b Start sessionMap – connect to Jaeger and enable opentelemetry using –ext option using coursier
  • 32. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-session-queue" -jar selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) sessionqueue c Start sessionQueue – connect to Jaeger and enable opentelemetry using –ext option using coursier
  • 33. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-distributor" -jar selenium-server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) distributor --sessions http://localhost:5556 --sessionqueue http://localhost:5559 --bind-bus false d Start distributor – connect to Jaeger and enable opentelemetry using –ext option using coursier
  • 34. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-router" -jar selenium- server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) router --sessions http://localhost:5556 --sessionqueue http://localhost:5559 --distributor http://localhost:5553 e Start router – connect to Jaeger and enable opentelemetry using – ext option using coursier
  • 35. Selenium Grid 4 Observability Setup 3 Running Selenium Grid with OpenTelemetery Java extension classes connected to the running instance of Jaeger We will be running distributed grid java -D"otel.traces.exporter=jaeger" - D"otel.exporter.jaeger.endpoint=http://164.52.192.223:14250" - D"otel.resource.attributes=service.name=selenium-node" -jar selenium- server-4.0.0-rc-2.jar --ext $(cs fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc- netty:1.35.0) node f Start node – connect to Jaeger and enable opentelemetry using – ext option using coursier
  • 38. Selenium Grid 4 Observability Setup 4 Add the necessary telemetry dependencies in selenium client and run the code a Add telemetry related dependencies in POM file https://gitlab.com/adigindia/atagtr2021selenium4observability
  • 39. Selenium Grid 4 Observability Setup <dependency> <groupId>io.opentelemetry</groupId> <artifactId>opentelemetry-exporter-jaeger</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty</artifactId> <version>1.35.0</version> </dependency> <!-- https://mvnrepository.com/artifact/com.google.guava/guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>31.0.1-jre</version> </dependency> <!-- https://mvnrepository.com/artifact/io.netty/netty-handler --> <dependency> <groupId>io.netty</groupId> <artifactId>netty-handler</artifactId> <version>4.1.68.Final</version> </dependency> a Add telemetry related dependencies in POM file 4 Add the necessary telemetry dependencies in selenium client and run the code
  • 40. Selenium Grid 4 Observability Setup 4 Add the necessary telemetry dependencies in selenium client and run the code b Add system properties in selenium client code System.setProperty("otel.traces.exporter", "jaeger"); System.setProperty("otel.exporter.jaeger.endpoint", "http://164.52.192.223:14250"); System.setProperty("otel.resource.attributes", "service.name=selenium-java-client"); ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName", "chrome"); driver = new RemoteWebDriver(new URL(hubURL), capabilities); String hubURL = "http://localhost:4444";
  • 41. RUN THE CODE AND OBSERVE
  • 44. BRING NODE DOWN AND OBSERVE ON JAEGER
  • 47. Key references 1. https://www.selenium.dev/blog/2021/selenium-4-observability/ 2. https://www.selenium.dev/documentation/webdriver/remote_webdriver/ 3. https://github.com/manoj9788/tracing-selenium-grid 4. https://get-coursier.io/docs/cli-installation 5. https://www.ibm.com/docs/en/sdk-java-technology/7.1?topic=jjc-specifying-java- options-system-properties-2 6. https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta- 1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt 7. https://opentelemetry.io/docs/java/ 8. https://www.lambdatest.com/blog/selenium-grid-4-tutorial-for-distributed-testing/ 9. https://www.browserstack.com/guide/selenium-grid-4-tutorial 10.https://docs.docker.com/compose/environment-variables/ 11.https://github.com/SeleniumHQ/docker-selenium