Loading video player...
Hi everyone, welcome to technology
worldub. My name is Anil.
In this playright series,
we are going to discuss
playright architecture.
So let's start this.
Playride follows a client server
architecture
where your test script communicates
directly with the browser engine that is
server using browser specific dev tools
protocols.
Okay,
how exactly it happens?
Test script
that is client. The script is client
here which is written in
let's say in Java, JavaScript, Python, C
etc.
Okay,
this communicates directly with the
browser engine. Browser engine is the
server using browser specific dev tools
protocols.
Okay,
this makes it faster, more reliable and
independent of web driver unlike
selenium.
Okay, that's why it is faster, more
reliable and independent of web driver
unlike selenium. So it doesn't require
web driver
if you understand highle architecture
diagram.
So here
test script what is test script? Test
script is written using Java,
JavaScript, Python, CR etc.
Those communicate with playright core
that is playright API or client library.
These are test script is
kind of it's a playright API or client
library. Okay.
Then playright
client library communicates with
playright core that is browser driver
layer.
Then playright core
basically
it is
a browser
protocol that is dev tools or CDP
and playright core will communicate with
browser engine using dev tools.
Okay. Then browser engine that is
Chromium, Firefox, WebKit the These are
the real browser.
Okay, that's how the communication is.
Okay.
Yeah.
Then
we need to understand
let's understand components of playright
architecture. First one is test script.
Test script is nothing but client.
Test script is written in Java,
JavaScript, Python or C#. It defines
what actions to perform that is
navigate, click, type etc.
Okay, that is test script. Test script
is client here which is written in
different language and it defines what
actions to perform.
Okay, either we will navigate or we will
click or we type etc. These are the
actions we need to perform.
The playright client library
converts your code into browser
commands. So playright client library
will converts code into browser
commands.
available in multiple language.
Okay. And playright core that is driver
layer.
It communicates directly with browsers
using browser specific protocols like
chrome dev tools protocol. Okay. This is
playright core that is driver layer. So
it communicates directly with browsers
using browser specific protocols like
Chrome dev tools protocol. Okay.
Then browser engines
these are real browsers that is
Chromium, Firefox, WebKit where the test
actually runs.
Browser engines are nothing but these
are the real browsers like Chromium,
Firefox, WebKit where the test actually
runs.
Okay. Then contexts and pages. Playrite
creates
browser contexts like isolated
incognito windows and pages that is tabs
for parallel and independent tests.
Okay.
What are browser content? These are like
isolated incognito windows and private
windows and pages tabs for parallel and
independent tests. Okay,
these are the components of playright
architecture.
Okay.
Test script that is client, playright
client library,
playrite core that is driver layer,
browser engines and context and pages.
Okay.
Next, how playright works.
If you'll understand step by step then
test script starts execution.
Okay. That exactly we write with
different language Java, JavaScript, C#
any language. Then playright client
sends JSON based commands like click,
fill, navigate to playrite core. Okay,
playright client, playrite
client send JSON based commands. Okay.
Like click, feel, navigate, any kind of
action to playright,
playright core. Okay.
Then playright core translates them into
browser specific instructions via dev
tools protocol.
Okay.
Playright Core core transfers
the commands JSON based commands into
browser specific instructions via dev
tools protocol.
Then browser engine executes those
actions in the actual browser.
Okay. Response and result that is page
title, text, screenshot is sent back to
the test script.
Okay.
Response or result send back to the test
script.
Then
key concepts in architecture. Let's
discuss that is browser. The actual
instance of Chrome, Firefox, Safari
being controlled.
Okay.
Browser context independent browser
sessions like a new incognito window.
Then page a single browser tab inside a
context.
Selectors or locators used to identify
elements on the page.
Auto waiting mechanism. Playrite
automatically waits for elements to be
ready before performing actions.
Okay. Playright automatically waits for
elements to be ready before performing
actions.
Next,
let's compare between playright versus
selenium architecture
communication.
Playright direct via dev tools protocol.
Selenium indirect via web driver.
Okay.
Speed very fast. No intermediate server
and selenium slower. HTTP request
overhead.
Reliability play rate is high. Selenium
is moderate.
Architecture
client browser directly.
Okay.
Client to browser
direct communication.
Selenium client web driver browser. So
basically one web driver is required
for communication between client to
browser but in playright client will
directly communicate to the browser.
Okay
then if we summarize this then playright
uses direct communication with the
browsers that's why it is fast and
reliable.
It supports multiple browser contexts,
enables parallel testing in a single
browser instance.
It provides cross browser and
crossplatform automation.
It has built-in tracing, recording and
debugging tools.
Okay. Play has built-in tracing,
recording and debugging tools.
If we understand in diagrammatic way
test script which is written in
Java, JavaScript, Python, CERF which
will communicate with playright client
library. PL playright client library
will communicate with playrite core that
is browser protocol or dev tools or CDP
through playrite core.
It will communicate with browser engine
that is real browser chromium, firefox,
webkit.
Okay, that's why play right is
faster.
Okay, and reliable.
Yeah, that's it for this session. I will
come up with
next session. Till then, take care.
Bye-bye. Please like it.
Subscribe the channel. Share with your
friends and family. Anything you put in
the comment box, I will reply you. Thank
you so much, guys.
Unlock the power of Playwright by understanding its core architecture and internal design. In this video, we’ll take a deep dive into how Playwright works — from browser drivers to browser contexts, pages, and automation flow. You’ll learn: ✅ What is Playwright Architecture ✅ Core Components: Browser, Context, Page, Frame ✅ How Playwright handles Chromium, Firefox & WebKit ✅ Playwright Client-Server communication ✅ How Playwright ensures fast, reliable, cross-browser automation ✅ Tips for designing a scalable Playwright test framework (Java, TypeScript, Python) Whether you’re a QA Automation Engineer, SDET, or Technical Lead, this video will help you understand Playwright at an architectural level to build efficient, maintainable test frameworks. 📘 Topics Covered: Playwright Architecture Overview Browser Context & Page Model Playwright Process Flow Framework Design for Test Automation Integration with CI/CD 🔔 Subscribe for more episodes in the “Playwright with Java Series”: Episode 1: Introduction to Playwright Episode 2: Playwright Architecture (this video) Episode 3: Framework Setup with Java + Cucumber