Category: Java

Handle ‘double click’, ‘drag and drop’ using Playwright Java

In this blog we will be utilizing Playwright Java to handle double click, drag and drop. Topics that we will cover: Handle double click Handle drag and drop Source code (double click) Source code (drag and drop) Handle ‘double click’ To understand double click, go to https://api.jquery.com/dblclick/   As can be seen above, there is a […]

Gestures (Slider, Resizable elements) in Playwright Java

In this blog we will be utilizing Playwright Java to handle gestures. Topics that we will cover: Handle sliders Handle resizable element Source code (slider) Source code (resizable) Handle sliders To understand sliders, go to https://jqueryui.com/resources/demos/slider/default.html    As can be seen above, there is a slider that we can move to right and left on […]

Create TestNg Test using Playwright Java

In this blog we will be utilizing Playwright Java to create a TestNg Test. Topics that we will cover: Add TestNG maven dependency Create TestNG test Source code Add TestNG maven dependency We start by adding TestNg dependency in pom.xml Navigate to below site  https://mvnrepository.com/artifact/org.testng/testng    Paste in pom.xml file  Note: The dependency (see below) […]

Handling frames in Playwright Java

In this blog we will be utilizing Playwright Java to handle frames. Topics that we will cover: Fundamental overview of frames Handle frames Source code Fundamental overview of frames  A frame refers to an HTML page that is inserted into another page.  Launch https://paytm.com/ and hit ‘Sign In’ button   A distinct window pops up […]

Launch Non-Incognito Browser Windows using Playwright Java

In this blog we will be utilizing Playwright Java to launch non-incognito browser windows. Topics that we will cover: Launch browser in incognito (private) mode Launch Non-Incognito (normal) Chromium Browser Launch Non-Incognito Chrome Browser Launch Non-Incognito Chrome Browser Default Profile Source code (incognito mode) Source code (Non-Incognito Chromium Browser) Source code (Non-Incognito Chrome Browser) Source […]

Data Driven Testing using Playwright Java

In this blog we will be utilizing Playwright Java for the execution of Data Driven Testing with ease. Topics that we will cover: Parameterize Test using dataProvider in same file Parameterize Test using dataProvider in separate file Source code (dataProvider in same file) Source code (dataProvider in different file) Source code (external dataProvider) Parameterize Test […]

Take Screenshot and capture video using Playwright Java

In this blog we are going to see how to take screenshot and capture video using Playwright Java.  Topics that we will cover: Take screenshot of a page  Take screenshot of an element Capture video Source code (page screenshot) Source code (element screenshot) Source code (video capture) Take screenshot of a page Let us say […]

Browser based Authentication and handling shadow root elements in Playwright Java

In this blog we will see how Playwright Java enables browser-based authentication and provides the capability to handle shadow root elements.  Topics that we will cover: Handle browser based authentication Handle Shadow root elements Source code (browser based auth) Source code (shadow root) Handle browser based authentication Navigate to https://the-internet.herokuapp.com/  You would see   Notice […]

Authenticate automatically using Json file in Playwright-Java

In this blog we will automatically authenticate by utilizing a Json file within Playwright-Java for seamless verification.  Topics that we will cover: Automate simple login scenario Store login authentication steps in json file Use json file to authenticate login functionality Source code (login using playwright) Source code (generate json) Source code (using json to automatically […]

Emulate/Mock GEO Locations using Playwright Java

In this blog we will learn about how to mock/emulate geo locations using playwright java.  Topics that we will cover: Mock geo location using Playwright-Java for kfc website Mock geo location using Playwright-Java for whatmylocation website Source code Mock geo location using Playwright-Java for kfc website To explore this concept, go to https://locations.kfc.com/ This website […]