00:00:01
hi everyone welcome you all
this is Pavan from SDA Channel
00:00:05
so from today we are going to
start a new series on playwright
00:00:10
and which is becoming very popular nowadays
in the market so just like selenium so the
00:00:14
playwright will also support multiple operating
systems multiple languages multiple browser
00:00:19
so let us see the introduction part like what
is playwright and what it will support and
00:00:24
finally we will also compare playwright with
selenium and then Cyprus now let's get started
00:00:32
so this is their official website of playwright
playwright.dev and in their website they
00:00:37
clearly mentioned playwright enables reliable
end-to-end testing for modern web applications
00:00:44
so through by using play Red we can automate uh
modern web applications and along with those web
00:00:50
applications we can also automate uh apis
and which will also support browser-based
00:00:56
applications in the mobile but it will not support
mobile native apps okay so this is the definition
00:01:02
they have given clearight enables a reliable
end-to-end testing for modern web applications
00:01:07
and which will also support multiple languages and
which is also having a community and they provided
00:01:14
lot of documentation very clear documentation and
based on that let us try to understand uh what
00:01:20
is play rate and what are the different features
which will support so the first thing is whenever
00:01:25
you are learning about the tool right first of all
we need to know what exactly which will support
00:01:31
so basically when you compare with applications
when you're talking from the applications
00:01:35
Prospect 2 so playwright support all kinds of
web applications and mobile web apps along with
00:01:41
the apis so applications prospective playwright
supports web browser applications or web based
00:01:50
applications and mobile web applications and then
apis so we can also test apis by using playwright
00:01:58
and when you come to the languages prospective
so just like a selenium favorite will also
00:02:03
support multiple languages like basically
which will support JavaScript and it will
00:02:09
also support typescript and also Java Python
and net so these are the programming languages
00:02:17
basically support by playwrite JavaScript
and typescript Java Python and dotnet
00:02:23
and a different kind of documents are also
available in their official website if you want to
00:02:28
use JavaScript there is a different documentation
is available for typescript Java python there
00:02:33
is separate documentation is available in their
official website if I look at this so initially
00:02:37
they started from node node.js that means which
will support JavaScript and if I just go here and
00:02:43
documentation docs and this is the documentation
clearly they have created from the basic like from
00:02:49
the installation everything how to write the
test how to run the test test generator and
00:02:54
so many features they clearly mention everything
in their documentation similarly if I select the
00:02:58
python so the same documentation is available
in the Python language and similarly Java so
00:03:04
all the documentation is clearly available in the
Java as well as dot net so these are the current
00:03:09
languages which will support it by playwright now
when you come to the browser support error so what
00:03:15
kind of browser switch will support so when you
come to the browsers almost it will support all
00:03:21
kinds of browsers like chromium-based browser
so there are different set of browsers which
00:03:25
are available in the market all are chromium based
so chromium based browsers will be supported along
00:03:31
with webkit especially for Safari browser for Mac
users and Firefox so all browsers uh headed mode
00:03:38
and headless mode both are supported by default
headless mode will be supported and if you want
00:03:42
to execute our test in the head mode headed mode
we can still exit out as cases in the headed mode
00:03:47
so when you come to the browser's supporting
chromium browsers will be supported so what
00:03:51
are the chromium browsers are available so let me
just go and fetch what are the browsers which are
00:03:57
supported chromium so if I just select like the
chromium or we can find list of chromium browsers
00:04:08
now you can see these are the different list of
chromium browsers like Opera epic Microsoft Edge
00:04:13
Brave Sim browser so these are all different
browsers which will use internally chromium
00:04:18
so even Google Chrome Right Touch these are all
chromium based web browsers so all these browsers
00:04:24
are supported by playwright and apart from this
which will also support Safari and especially
00:04:31
for Mac users and as well as Firefox and both
headed and headless mode will be supported
00:04:37
and now when you come to the operating system
support so which will support Windows Linux as
00:04:43
well as Mac so all kinds of operating systems
will be supported and along with the ca run
00:04:48
so we can also run our playwrite test on remote
environments and Jenkins or any other continuous
00:04:53
integration tools we can run so multiple languages
are supported multiple browsers are supported
00:04:59
multiple operating systems also supported now
when you come to the especially features what
00:05:05
are the main features are playing right so let me
list out what are the main features of player ID
00:05:12
so as we already discussed the playwright
is completely free and open source
00:05:20
free and open source what is a free means is
we no need to buy any license for it we can
00:05:25
simply install and we can start using the click
writer anybody can download and you can use it
00:05:31
and open source in a sense is a customized
so if you want to customize the tool you can
00:05:36
still customize you can add some more features
and you can contribute your time and effort
00:05:40
so that's called open source so free means
what we don't need to buy any license we can
00:05:45
simply install the tool download and install and
open source means we can customize the tool if I
00:05:51
want to add any third party libraries or if you
want to add any other features external features
00:05:55
you can still add them into a particular
tool so free and completely open source
00:06:01
and which will also support multi-browser multi
languages and multiple operating systems so these
00:06:07
are the main features because of this the tool
is becoming very popular even selenium is also
00:06:13
supporting multiple browsers multiple languages
multiple operating system same thing here
00:06:18
playwright is also supported multiple browsers as
we discussed earlier chromium Safari Firefox and
00:06:24
Etc and it will also support multiple languages
like JavaScript typescript Java Python c-sharp and
00:06:30
Etc and it will also support multiple operating
systems so this is another biggest feature from
00:06:36
Playmate and setup and configuration is very very
easy when you compare with the selenium and other
00:06:42
two setup and configuration is very very easy
apply right and what it will support what we
00:06:47
can do by using this playwright we can automate
functional test cases functional type of test
00:06:52
cases we can also automate apis and in addition
it will also additionally support accessibility
00:06:58
testing accessibility testing so but we can you
we have to use some third party plugins we have
00:07:06
to integrate with the playwright so that we
can also do accessibility testing along with
00:07:10
the functional and also accessibility testing a
functional and apis by default it will support but
00:07:18
if you want to do accessibility testing we have to
add some third party plugins with the playwright
00:07:22
and what else it will support So built-in reports
reporters are there suppose if you work with a
00:07:27
cilium or any other tools we need to rely on some
other third party libraries or third-party plugins
00:07:33
to generate the reports but here playwright is
our by default is having built-in reporters so
00:07:39
by using those built-in reporters we
can automatically generate our reports
00:07:46
and also if you want to generate any custom
reports we can still generate the custom reports
00:07:51
suppose this built-in reports you do not like
so then we can also generate some custom reports
00:07:56
and apart from this which will also support all CA
environment like Ci CD and Docker integration is
00:08:05
also supported and especially when you're talking
about web automation testing we'll always uh
00:08:12
need cross browser testing and parallel testing
so just like a selenium and Cyprus which will also
00:08:19
support parallel testing so parallel testing is
supported but in selenium so we have to depend on
00:08:26
test engine right but here we no need to depending
on any other third party libraries so play rate
00:08:31
by default support uh parallel testing and the
next important feature is what Auto weight this
00:08:38
is another important feature from collaborator so
what is the use of Auto weight especially when you
00:08:43
face any synchronization problems while automating
while executing your test cases on the browser
00:08:48
so to solve those synchronization problems so
normally we use a different type of weights
00:08:52
right if I are working on selenium so we have
to use something called implicit weight explicit
00:08:57
or grade weight right even Cyprus is also having
some building Auto weight mechanism so similarly
00:09:02
playwright is also having built-in Auto weight
mechanism but which is not there in selenium so we
00:09:08
no need to add any explicit weight statements in
script automatically clear rate will wait for the
00:09:13
elements wait for page loading in the different
scenarios so we don't need to add any additional
00:09:20
weights in playwright test cases and that is a
one more additional benefit from the playwright
00:09:26
which is also having built-in assertions
built-in assertions right so built-in
00:09:34
assertions means we need to uh use assertions
which is by default provided by playwright
00:09:39
okay and if you go with other tools like psyllium
so we have to use test engine assertions and if
00:09:44
you go with the Cyprus we use also smoke our chai
Library assertions similarly flavor it is also
00:09:49
provided some built-in assertions and by using
those accessions we can write all the validations
00:09:56
and because of that there are less likely tests
flaky test in the sense water sometimes when
00:10:02
you run your test cases it will execute and
pass sometimes it will not pass so you will
00:10:07
find most of the time sun stability while
executing your test cases so those type
00:10:11
of problems will automatically resolve
because of this reason in the playwright
00:10:17
okay and the next one is uh multi-tab and
multi Windows supporter this is another
00:10:23
most important feature from planet multi dab and
multi Windows supporter suppose if you are opening
00:10:31
any application right so when you click on some
link or when you click on some button which will
00:10:35
navigate to the another Tapper which will open
another application or another browser window
00:10:39
so in psylliums we have a different type
of switching commands so by using switching
00:10:44
commands we can just switch to another tab
or we can switch to another window browser
00:10:47
window then we can interact with the elements
or whatever operations we can do we can do it
00:10:52
all right here where we have to use insulin we
have to use something called switching commands
00:10:56
in the playwrite also multi-tab and multiple
window support is available but which is not
00:11:02
there in Cyprus so this is the additional feature
which is there in the frame rate and along with
00:11:07
this which will also support uh different kinds
of frames iframe support is also there and also
00:11:13
we can automate uh Shadow time elements
we can easily identify Shadow Dom elements
00:11:18
uh in playwright okay and uh which will also
support parameterization So when you're working
00:11:26
with the selenium so we have to use test engine
like data provider or we can pass parameters to
00:11:31
XML file but here this is also in the playwrite
also the parameterization concept is supported
00:11:37
and then we can also emulate mobile devices
so that means what whenever you do some kind
00:11:45
of mobile app testing like suppose if you
want to test some uh applications on the
00:11:49
mobile right normally you open the browser
and then you will bring your application URL
00:11:55
so to test those type of applications so emulate
we can also easily emulate mobile devices that
00:12:01
means whatever application you are testing on the
web or browser the same application we can easily
00:12:07
test on mobile browser so for that it will provide
some kind of emulation so because of that feature
00:12:13
we can easily achieve this and when you compare
with other tools playwright is very faster than
00:12:20
other tools so very very fast the execution will
be very faster when you compare with the selenium
00:12:25
and Cypress so these are the most important
features they have mentioned in their official
00:12:31
documentation so if I just go to their official
web page whatever features the playwright is
00:12:37
supported all the features they have mentioned
everything in their website so you can see any
00:12:42
browser any Platform One API like cross browser
class platform cross language and we can also
00:12:48
test mobile web so all the features are supported
and the reason a resilient no flag attachments
00:12:54
unstable unstability will be overcome so sometimes
we will execute the test cases sometimes it will
00:13:00
fail the same test cases again if you run it will
be failed so that is a basically uh the reason
00:13:07
behind that is we will integrate multiple tools
right so because of that unstable issues normally
00:13:12
we will we will see while executing our test cases
but that problem is automatically solved uh in
00:13:18
the play right because of built-in assessions
because Auto weight mechanism already there and
00:13:23
the web first assessions are assertions built-in
assessions are provided and raising uh facilities
00:13:29
there so because of this there are no flacky
tests flaky tests in the sense unstable test and
00:13:36
there are some more features they have provided in
their website so no trade-offs or No Limits Full
00:13:41
isolation fast execution and Powerful tooling so
it will also provided some tools called cold gen
00:13:47
code generator and playwright inspector traceview
or we can easily locate the elements so playwright
00:13:53
itself is provided a mechanism to inspect the
elements on the web that's called playwright
00:13:58
inspector today's viewer so we can easily see the
step-by-step execution how exactly the tests are
00:14:04
executed using traceviewer and code regenerator
and there are two methods we have in the play
00:14:09
rates we can automatically we can write our own
script for automating applications and we can also
00:14:16
automatically generate the code so that feature
is also available we can achieve this by using
00:14:20
Code gen so these are the different features they
have provided in playwright along with this they
00:14:26
have clear documentation whichever language you
are using with the playwright you can easily get
00:14:31
the documentation step by step documentation for
every language they provided like python node.js
00:14:37
java.net each and every step clearly they have
mentioned in the documentation it's more clear
00:14:42
and we can easily understand uh by reading this
documentation step by step okay this is a document
00:14:49
and Community Support they are having their
own GitHub repositories they are having their
00:14:53
own Community stack Overflow and YouTube channel
blogs and in their news they will provide all the
00:14:59
feeds so they're having their own community so we
can also join that community and we can post the
00:15:04
queries or we can ask some new features uh from
this particular tool we can suggest all the new
00:15:10
features in this particular tool so required
communities also maintain okay this is a basic
00:15:16
information about playwright so now we will just
compare leave it with the selenium and Cyprus
00:15:22
so what I'll do is let me share a small picture
yeah now feature based let us compare the tools
00:15:29
based on the different features so the first
feature is what browser supported so what are
00:15:36
the different browsers are supported so if I look
at the play rate as we discussed chromium webkit
00:15:42
which is Safari and Firefox will be supported and
then selenium will support Chrome Firefox offer
00:15:48
hi and Etc and Cyprus will support only Chrome
Firefox and Edge browsers and when you come to
00:15:54
the programming languages play rate support
Java python javascript.net which is c-sharp
00:16:01
will also support multiple languages there are
Cyprus support only JavaScript and typescript
00:16:10
and operating systems when you come to the
operating system point of view which will support
00:16:14
only Windows Mac OS and Linux and similarly Cyprus
or selenium also support Windows Mac OS and Linux
00:16:22
and Cyprus also will support Windows
Mac OS and Linux so operating system
00:16:27
wise almost all the tools having same kind of
supporting now when you come to headless mode
00:16:33
we can execute tests in the Headless mode and
that is the default and the selenium also we can
00:16:39
execute in the Headless and even Cyprus also
we can execute tests in the Headless mode so
00:16:44
headless mode support is there on all three
tools and when you come to the Cross browser
00:16:48
testing also all the tools will support cross
browser testing means which will support multiple
00:16:52
browsers we can execute our test in multiple
browsers at the same time so that feature is
00:16:57
available in all the tools but in seleniums we
can achieve this cross browser testing is there
00:17:02
but if you want to execute or test in multiple
browsers again we need to take the help of test Ng
00:17:08
same thing parallel execution means what in
the playwright parallel execution is a built-in
00:17:12
feature which is there but in selenium so we
have to take the help of test NG then we can
00:17:16
achieve parallel execution and Cyprus will also
support parallel execution and when you come to
00:17:22
the auto weights and Cypress and the playwright so
these two tools are having built-in Auto weights
00:17:28
so we no need to use any explicit weights but
when you come to the selenium so we have to use
00:17:34
some different type of ways like implicit explicit
and plan twins so AutoVoice prospective there is
00:17:39
a difference and playwright and Cyprus by default
is having Auto edit it will automatically wait for
00:17:46
the elements and Page loading and so on suppose
when you're interacting with some element so
00:17:51
clever it is always automatically wait for that
element internally it will also have their own
00:17:55
built-in assertions right so because of that it
will wait for the element automatically and then
00:18:00
once the elements are available once the page is
loaded then further actions will be performed so
00:18:05
that is another good feature which is there in
the private and Cyprus and then multi-tab and
00:18:10
multi-window supported and multidab window support
in the playwright and selenium so in both the
00:18:16
tools we have this feature but uh in the Cyprus we
do not support multi-tab and multi window feature
00:18:22
and real-time test execution so real-time test
execution in the sense what on the runtime on the
00:18:29
real browser the test will be executed so only
in the Cyprus it is possible in the playwrite
00:18:34
Silicon when you launch your browser it will open
the browser and it will create their own profile
00:18:40
it will not live execution actually but when
you go to the Cyprus it will execute the test
00:18:46
on the browser at the runtime and playwright
selenium is having their own browser profile
00:18:52
and then execution will happen so real-time
test execution is Possible only in the Cyprus
00:18:57
and rest of the tools are not supported
now when you come to the debugging part
00:19:02
uh play rate is having built-in debuggers and also
we can use devtools integration for debugging the
00:19:09
code and when you come to the selenium integration
with the browser developer tool so psyllium is
00:19:15
basically when you want to debug the tool just
like uh Java debugging options we can use and
00:19:20
in the dev tools we can check exactly what are
the different apis or calling and uh when you
00:19:27
come to the Cyprus built-in debuggers and devtools
integration just like a playwright which is also
00:19:31
having built-in debuggers and also we can take
the help of devtools integration and the API
00:19:37
testing is supported in playwright and Cyprus but
not selenium so again we have to use some third
00:19:42
party libraries Java based libraries like HTTP
request or rest assured along with the Java and
00:19:48
then we can achieve it it can be Java or python
whatever so API testing directly not supported
00:19:54
but by integrating some third-party plugins we
can achieve API testing in silium but clearwright
00:19:58
Cypress by default support API testing and when
you come to the Community Support playwright and
00:20:04
Cyprus is growing Community barcelium is already
established community so because which was there
00:20:09
from since long time so there is large communities
help and documentation everything is available
00:20:15
for selenium but playwright and Cyprus uh he
being also growing community so now they are
00:20:21
also having communities but it's still growing it
it's not fully established just like a selenium
00:20:27
and when you come to the testing Frameworks
so playwright basically used with the popular
00:20:32
Frameworks like just mocha and Etc and uh selenium
so we have to again integrate some third party
00:20:39
rules like test engine Etc but when you come to
the Cyprus uh it is a mocha framework internal
00:20:46
it will use so we need to write all the tests in
the mocha framework which is a default style of
00:20:52
writing the test in the Cyprus but in play every
playwright which will support like just mocha also
00:20:57
which will support and they are inter built-in
Frameworks which by default support in playwright
00:21:02
and Cypress but if you want to implement any
framework in cm so we have to customize we have
00:21:07
to create our own framework like hybrid framework
or data driven or module or something like that
00:21:11
but when you come to the playwright in Cyprus
by default they will support they will provide
00:21:16
some kind of framework from mocha so all the
assertions and everything we can use from the
00:21:21
from their Frameworks and performance wise
obviously the playwright and Cyprus are very
00:21:29
faster than selenium so because in the selenium it
will internally use mediatory uh protocols right
00:21:37
it will not directly interact with the browser so
it will connect through browser-specific drivers
00:21:42
through w3c protocols it takes some time to
execute so obviously the performance will be
00:21:48
lesser than other so when you come to the
playwright and Cyprus it will directly
00:21:52
execute the code on the browser and directly
will interact so obviously the performance will
00:21:58
be faster than celium when you compare with the
sillium so playwright and Cyprus performance will
00:22:03
be faster okay so this is basically the comparison
so what exactly uh support and what exactly is not
00:22:11
supported so playwright slowly becoming popular
in the market because mainly these three reasons
00:22:17
which will support multiple operating systems
multiple browsers multiple languages just like
00:22:21
a syllium and moreover it is completely free and
open source tool so because of that reason uh
00:22:27
clear rate is becoming uh popular nowadays in the
market so you can just learn play right by using
00:22:34
any of the language you can use either JavaScript
or Java or python whatever she sharp or whatever
00:22:41
and uh most popular language is Javascript
so most of the companies are using play
00:22:46
rate with the JavaScript so the reason behind it
basically Java playeret is implemented on node.js
00:22:52
environment which will by default support
JavaScript so many people will use private
00:22:58
with the JavaScript just like a psyllium right
psyllium most of the people uh 70 Mark 70 of the
00:23:04
market capture is limited Java combination even
though it is supported other languages similarly
00:23:17
most of the people most of the companies
are preferring to use playwright with the
00:23:21
JavaScript as a primary language and it is
better to learn JavaScript because most of
00:23:27
the people are already aware of python and Java
because they are there from since long time and
00:23:34
uh many people already know selenium so how to
write out automation test using selenium with the
00:23:40
Java as well as python so it is the right time to
learn some other language and the two JavaScript
00:23:46
and which will be used in many tools and most of
the probably in future most of the tools are also
00:23:55
may use JavaScript as a primary language so if
you already know Java and python so then better
00:24:01
to go with the JavaScript so from the next session
I'm going to start playwright with the JavaScript
00:24:07
because which is very popular when you compare
with the other languages okay so that's all for
00:24:13
this video so in the next video we will see the uh
installation part like how can we download how can
00:24:19
set up the environment and then how can we write
a basic test in the playwright and then we will
00:24:25
see some more topics so that's all for this video
thanks for watching we'll see in the next video