1. What Is Playwright?
Let’s start from the beginning.
- 1. What Is Playwright?
- 2. Why Do Manual Testers Struggle With Automation?
- Programming
- 3. What Is AI-Assisted Automation?
- 4. How AI Playwright Automation Can Help Beginners
- 5. Converting Manual Test Cases Into Playwright Code
- 6. Understanding page.goto()
- 7. Using AI to Understand Locators
- 8. Don’t Blindly Copy Locators
Playwright is a test automation framework used to automate web applications. You can learn more about Playwright in the official Playwright documentation
Think about what a real user does on a website.
For example, on an e-commerce website, a user might:
Open website
↓
Search for a product
↓
Select product
↓
Add product to cart
↓
Open cart
↓
Verify product
A manual tester performs these steps manually.
With Playwright, we can automate these actions.
For example:
await page.goto('https://example.com');
await page.getByPlaceholder('Search').fill('Laptop');
await page.getByRole('button', { name: 'Search' }).click();
The automation tool performs actions on the browser.
This is why Playwright is useful for repetitive testing.
2. Why Do Manual Testers Struggle With Automation?
Let’s be honest.
Most manual testers don’t struggle because they don’t understand testing.
They struggle because automation introduces a new skill:
Programming
A manual tester may understand:
- Test scenarios
- Test cases
- Regression testing
- Smoke testing
- Functional testing
- Exploratory testing
- Defect reporting
- User workflows
But automation introduces concepts such as:
- Variables
- Functions
- Objects
- Conditions
- Loops
- Async/await
- Locators
- Assertions
- Classes
This can feel overwhelming.
For example, you may understand this manual test:
Test Case
Title: Verify successful login
Steps:
- Navigate to login page.
- Enter valid username.
- Enter valid password.
- Click Login.
- Verify dashboard.
You know exactly what should happen.
The challenge is:
How do I convert this into automation code?
This is where AI can help.
3. What Is AI-Assisted Automation?
AI-assisted automation means using AI tools to help you during the automation development process.
AI can help with:
Learning
Understand unfamiliar concepts.
Coding
Generate example code.
Debugging
Explain errors.
Test design
Suggest test scenarios.
Documentation
Explain what your automation does.
Practice
Give you exercises and challenges.
But AI should not become a replacement for your testing knowledge.
Think of it like this:
You = Tester
Playwright = Automation Tool
AI = Learning Assistant
You remain responsible for deciding:
What should be tested?
AI can help you understand:
How can I automate it?
For manual testers, AI Playwright Automation provides a practical way to connect existing testing knowledge with Playwright automation.
4. How AI Playwright Automation Can Help Beginners
There are many ways to use AI when learning Playwright.
Let’s go through them with practical examples.
5. Converting Manual Test Cases Into Playwright Code
This is one of the most useful things AI can do for beginners.
Suppose you have this manual test case.
Manual Test Case
Test Case: Login with valid credentials
1. Open login page.
2. Enter username.
3. Enter password.
4. Click Login.
5. Verify Dashboard.
Instead of trying to write the code yourself immediately, ask AI:
“I am a manual tester learning Playwright with TypeScript. I have the following test case. Show me how I can automate it and explain each line in simple language.”
AI may generate:
await page.goto('https://example.com/login');
await page.getByLabel('Username').fill('testuser');
await page.getByLabel('Password').fill('Test@123');
await page.getByRole('button', { name: 'Login' }).click();
await expect(page.getByText('Dashboard')).toBeVisible();
Now don’t just copy it.
Ask:
“Explain this code line by line like you are teaching someone who has only done manual testing.”
This changes AI from a code generator into a teacher.
6. Understanding page.goto()
Let’s take one line:
await page.goto('https://example.com/login');
If you are new to Playwright, ask AI:
“Explain page.goto in Playwright in very simple language.”
The basic idea is:
page.goto() tells Playwright to navigate to a URL.
Think about your manual testing step:
Open the login page.
The automation equivalent is:
await page.goto('https://example.com/login');
So you can create a simple connection:
| Manual Testing | Playwright |
|---|---|
| Open website | page.goto() |
| Enter text | fill() |
| Click button | click() |
| Select option | selectOption() |
| Verify result | expect() |
This is a great way for manual testers to learn automation.
7. Using AI to Understand Locators
Locators are one of the most important concepts in Playwright.
A locator tells Playwright:
“Find this element on the page.”
For example:
page.getByLabel('Username')
means:
Find the element associated with the Username label.
Another example:
page.getByRole('button', { name: 'Login' })
means:
Find the Login button.
If locators confuse you, ask AI:
“Explain Playwright locators to a manual tester using real website examples.”
Then ask:
“Explain getByRole, getByLabel and getByText with simple examples.”
You can also ask:
“I have a Login button. Show me different ways to locate it in Playwright and explain which approach is preferred.”
This helps you understand why a locator is being used.
8. Don’t Blindly Copy Locators
Suppose AI gives you:
page.locator('#loginButton')
You should ask:
“Why did you choose this locator?”
Maybe the page has a better accessible locator:
page.getByRole('button', { name: 'Login' })
The important lesson is:
Don’t just learn what works. Learn why it works.
This becomes especially important during interviews.
An interviewer might ask:
“Why did you use getByRole instead of XPath?”
You should be able to explain your decision.