Wednesday, July 23, 2025

Playwright Web Automation Testing Using Python





In this blogpost, we will discuss how to run Playwright automation tests using Python programming language on Visual Studio code IDE.

I’ll put the post in three points as shown below:
  1. Set Up
  2. Test Automation Framework with Playwright and Python
  3. Integrate Automation Tests with CI

1. Set Up
Do the following installations on your Mac.

  • Install Node: Run the command "brew install node" on your terminal. 
  • Install Python3: Go to Python3-Download


Check python3 version 



Check your path of python3 : Run the command "which -a python3"


Install Playwright & pytest
pip install pytest playwright



Install Playwright Browsers
playwright install


Create and Activate Virtual Environment
python3 -m venv venv


Install Pytest Plugin for Playwright Fixtures
pip install pytest-playwright



2. Test Automation Framework with Playwright and Python
basic boilerplate code using Page Object Design framework is created for this post and the folder structure, page objects, pages, tests and test report are shown below.

The Folder structure looks like this


 Page Objects:  The locators used for the tests. For ex: Login page locators below.

The framework is developed using Page Object Design Pattern.

 Pages : The individual web pages used for the test.

 base_page.py - Contains all the web actions used by the tests and will  
 be inherited by the the other pages like login page, cart page, Inventory  
 page etc..



login_page.py


Test:
test_end_to_end.py


The test will call the needed pages and in-turn in the pages will inherit the base page functions/methods to perform the web actions. Assertions are checked and put in place.

Run the Tests locally:
For all tests : pytest --html=reports/report.html
For specific test : pytest tests/test_login.py -s -v



Test Report: 
From your Report Folder 'reports/report.html'







3. Integrate Automation Tests with CI 
GitHub Actions:- 
Run the Tests on GitHub Actions 
Pipeline:


Create a folder .github/workflows and inside this folder create a yml file with name "playwright.yml" file as shown below


Go to GitHub Actions and check the run



Click on the first one



Click on test as shown below




Check the test report!


Save to your desktop to view the report.


Open the report.html file




For Test code reference, Please see the GitHub repo: https://github.com/JayKishoreDuvvuri/Playwright-Python

Happy Automation Testing Guys :)!

Saturday, July 5, 2025

Playwright podcast on Google's NotebookLM

 

Playwright Podcast generated by Google's NotebookLM - AI powered Research Assistant.



In this article, we will discuss how to generate a 20 minutes podcast for self-learning on playwright using Google's NotebookLM AI agent.

What is NotebookLM ?

NotebookLM is an AI-powered note-taking and research assistant developed by Google. It integrates with Google Docs and is designed to help users better understand, summarise, and generate content based on their own documents.

NotebookLM started as an experimental project called "Project Tailwind" in 2023 and has since evolved into a paid subscription service with expanded features for both enterprise and individual users.

  • Generate summaries, explanations, and answers based on user-uploaded documents.
  • Provide interactive Q&A grounded in the exact content the user uploads, such as PDFs, Google Docs, Google Slides, and websites.
  • Create creative content like scripts or brainstorming ideas based on the documents.
  • Offer podcast-style audio overviews that summarize documents in a conversational format, which is useful for users who prefer listening to content.

In summary, NotebookLM is a powerful AI-driven notebook designed to simplify research, note-taking, Self-Learning and content comprehension by providing personalised, source-grounded insights and summaries from your own documents.

Lets start.....

Open NotebookLm url : https://notebooklm.google/


Click on "Try Notebook" as shown below





Click on the + Create new button as shown above a new window will open



Here, you can click on the Website or Youtube link add your required links. You can also upload images or google docs or any random text .




Click on "Website" and type for example : https://playwright.dev/docs/ci
Similarly, add youtube link as well, if you want to.

I have used playwright here for an example. However, you can use anything in this AI tool as per your needs and requirement.



Click on "Insert" and you will see the screen like below



Here, you see two buttons Customise and Generate, your can either customise your requirements on how you like the audio to be generated.For now, I just click on "Generate" blue button.



If you get a screen like below, click on "Load"










Now the audio is loaded for you as a Podcast. You can either listen to the podcast here or you can also download the audio clip on your computer.

Usually, it gives you like a 20 minutes audio as a heads up, where you can self-learn quickly just like any other self-learning platforms but you will listen only to the audio. Still this is amazing, as it gives you full summary and good insights.

Enjoy the 20 minutes Podcast :)!

You can basically upload anything like docs, pdf, images, website or youtube links and get the information as 20 minutes Podcast. 

Happy Automation Testing Guys :)!

Playwright Web Automation Testing Using Python

In this blogpost, we will discuss how to run Playwright automation tests using Python programming language on Visual Studio code IDE. I’ll p...