Playwright annotations help QA teams control test execution, organize large test suites, manage unstable tests, and improve CI/CD execution. In real-world automation projects, annotations are heavily used for:
Smoke testing
Regression filtering
Environment-specific execution
Handling known bugs
Managing flaky tests
Faster debugging
CI pipeline optimization
Playwright provides built-in annotations such as:
test.only()
test.skip()
test.fixme()
test.fail()
test.slow()
Tags like @smoke, @regression, @sanity
It also supports custom annotations and runtime annotations using testInfo.annotations.
test.skip(browserName === 'firefox', 'Known issue in Firefox');
await page.goto('https://example.com');
await page.click('#checkout');
await expect(page).toHaveURL(/checkout/);
});
});
21. Recommended Annotation Strategy for Real Projects
Small Projects
Use:
@smoke
@regression
Medium Projects
Use:
@smoke
@sanity
@regression
@critical
Enterprise Projects
Use:
Browser-specific annotations
Environment-based skipping
Jira-linked annotations
CI-based tagging
Runtime annotations
Module-based grouping
22. Final Recommended Framework Workflow
Daily Execution
npx playwright test --grep @smoke
Nightly Regression
npx playwright test --grep @regression
Release Validation
npx playwright test --grep @critical
23. Best Practices Summary
Recommended
✔ Use tags for filtering ✔ Use fail() for known bugs ✔ Use slow() for long tests ✔ Use fixme() for broken scenarios ✔ Use custom annotations for Jira tracking ✔ Organize tests with describe() ✔ Maintain naming conventions
Avoid
✘ Permanent skipped tests ✘ Random tag naming ✘ Pushing test.only() to CI ✘ Too many annotations on one test
Answer: AI in software testing refers to the use of Artificial Intelligence and Machine Learning techniques to improve testing activities such as test case generation, defect prediction, test maintenance, test optimization, visual validation, and intelligent automation.
AI helps QA teams:
Reduce repetitive manual work
Improve test coverage
Detect flaky tests
Predict high-risk areas
Generate intelligent test data
Speed up regression testing
2. What is the difference between Traditional Automation and AI-based Automation?
Traditional Automation
AI-based Automation
Rule-based
Learns from data
Hardcoded locators
Self-healing locators
Requires frequent maintenance
Adaptive maintenance
Static scripts
Intelligent execution
Breaks easily on UI changes
Handles dynamic changes
Example: In Playwright or Selenium, if an XPath changes, traditional automation fails. AI-based tools can identify elements using attributes, text, position, or visual recognition.
3. What are Self-Healing Test Scripts?
Answer: Self-healing scripts automatically recover from UI changes by identifying alternative locators when the original locator fails.
Example:
If:
id="loginBtn"
changes to:
id="signinBtn"
AI tools analyze:
Text
CSS structure
Neighbor elements
Historical locator data
and automatically update the locator.
4. Name Some AI Testing Tools You Have Worked With
AI is transforming software testing and QA engineering by improving test creation, maintenance, bug analysis, reporting, and CI/CD automation. Modern QA engineers now use AI tools for:
Automated test generation
Self-healing locators
Visual testing
API testing
Test data generation
Root cause analysis
Intelligent reporting
Agentic test execution
Code assistance
Here are the top AI tools every QA engineer should know in 2026.
In Playwright, fixtures are reusable setup and teardown utilities that help you share test data, page objects, authentication, API clients, and configurations across tests.
Custom fixtures make your framework:
Reusable
Maintainable
Scalable
Cleaner and easier to read
1. What is a Fixture in Playwright?
A fixture is a setup environment provided to your test before execution.
Playwright already provides built-in fixtures such as:
Exception handling in JavaScript is used to manage runtime errors without stopping the entire program. It helps developers write stable and reliable applications.
What is an Exception?
An exception is an unexpected error that occurs while the program is running.
Examples:
Dividing by invalid values
Accessing undefined variables
Invalid JSON parsing
Network/API failures
Custom validation errors
Why Exception Handling is Important
Exception handling helps to:
Prevent application crashes
Show meaningful error messages
Debug applications easily
Handle API/database failures gracefully
Improve user experience
JavaScript Error Types
1. Syntax Error
Occurs when JavaScript code has invalid syntax.
console.log("Hello"
Output:
SyntaxError: missing ) after argument list
2. Reference Error
Occurs when accessing an undefined variable.
console.log(userName);
Output:
ReferenceError: userName is not defined
3. Type Error
Occurs when an operation is performed on the wrong data type.
let num = 10; num.toUpperCase();
Output:
TypeError: num.toUpperCase is not a function
4. Range Error
Occurs when a value is outside the allowed range.
let arr = new Array(-1);
Output:
RangeError: Invalid array length
5. URI Error
Occurs when URI functions are used incorrectly.
decodeURIComponent("%");
Output:
URIError: URI malformed
try…catch Statement
The try...catch block is the core of exception handling.