Open the browser and Close in Playwright Python

We will be discussing opening different types of browser and closing the tabs and browsers in Playwright python

Screenshot and Video in Playwright Python

We will discuss taking screenshots and recording videos in Playwright python

Handle Tabs and Windows in Playwright Python

We will use page.expect_page() from Playwright to handle the tabs/windows, once we store the page in a new variable we can use both the new page and the old page simultaneously

Handle IFrames in Playwright Python

When a developer wants to showcase a different webpage on the current page, then they use frames to show the webpage. It is like showing live shows on television. The page that is shown in the frame could be a page from a different website or a page from the same website

Handle dropdowns in Playwright Python

This article provides insight on how to interact with different types of dropdowns using Playwright in Python. It distinguishes between standard and custom dropdowns, providing methods for selecting options by value, text, index, element, or through JavaScript. It also illustrates handling custom dropdowns with clicks and a loop for selecting options. Additionally, it addresses multi-value dropdowns, showing how to select multiple options using the select_option function

Element State with Playwright Python

The article explores Playwright Python methods for assessing HTML element states. Key methods like is_checked() for selection, is_hidden() for absence, and is_visible() for perceptibility are discussed. is_disabled() and is_enabled() distinguish user-action capability. is_editable() verifies editability. For custom CSS, the article recommends using get_attribute()

Handle checkbox in Playwright Python

The check() function ensures a checkbox is selected, uncheck() deselects it, and is_checked() verifies its state. These functions provide a reliable approach, crucial for scenarios like login pages where checkbox states must be accurately controlled and checked

Page level commands in Playwright Python

This article introduces basic operations using Playwright, focusing on commonly used functions such as `goto()` for navigating to URLs, `page.url` for getting the current URL, `page.title()` for retrieving the webpage title, and `page.content()` for accessing the HTML content of the page. Sample code is provided for practical implementation

Navigation commands in Playwright python

We discuss the usage of the goto(), go_back(), go_forward(), and reload() methods in web automation using Playwright. These methods allow users to navigate to specific web pages, move back and forth between pages in the browser history, and refresh the current page. The provided Python code demonstrates their practical implementation

Click and custom click in Playwright Python

In Playwright Python, when dealing with multiple element matches, it’s essential to handle potential exceptions. Unlike Selenium, Playwright does not automatically click the first match. A custom function can be created to check the number of matches and click accordingly, ensuring robust automation and avoiding errors