41. How would you handle environment-specific URLs and credentials?
I would avoid hardcoding them inside test files.
- 41. How would you handle environment-specific URLs and credentials?
- 42. How would you prevent passwords and tokens from appearing in test reports?
- 43. How would you design reusable test utilities?
- 44. What would you do when the application changes its UI frequently?
- 45. How would you review another QA engineer’s Playwright code?
- Functionality
- Locator quality
- Synchronization
- Maintainability
- Test independence
- Readability
- Failure diagnosis
- 46. How would you reduce duplicate automation code?
- 47. How would you decide what should be a reusable fixture?
- 48. How would you handle a test that fails only on one machine?
- 49. How would you explain the value of Playwright automation to a non-technical manager?
Instead, I would use environment configuration.
For example:
QA URL
UAT URL
Production-like URL
Credentials should be managed securely through environment variables or the CI/CD secret-management mechanism.
42. How would you prevent passwords and tokens from appearing in test reports?
I would never hardcode sensitive credentials in test files.
I would use:
- Environment variables
- CI/CD secrets
- Secure credential management
I would also make sure logs, screenshots, and reports do not unnecessarily expose secrets.
43. How would you design reusable test utilities?
I would first identify repeated logic.
For example:
generateUniqueEmail()
createTestUser()
formatDate()
readTestData()
I would only create utilities when they genuinely improve reuse.
Creating a utility for every two-line action can make the framework harder to understand.
44. What would you do when the application changes its UI frequently?
I would first determine whether the changes are expected or unstable.
Then I would:
- Prefer stable locators
- Keep selectors centralized
- Use Page Objects where appropriate
- Avoid fragile CSS/XPath chains
- Communicate with developers about testability
I would also review whether the application’s UI provides suitable accessibility or test attributes.
45. How would you review another QA engineer’s Playwright code?
I would review:
Functionality
Does the test validate the correct requirement?
Locator quality
Are locators stable?
Synchronization
Are there unnecessary fixed waits?
Maintainability
Is duplicate code present?
Test independence
Can the test run alone?
Readability
Can another engineer understand the test easily?
Failure diagnosis
Will the report clearly show what failed?
46. How would you reduce duplicate automation code?
I would identify repeated:
- Login logic
- Navigation
- Data creation
- Assertions
- API setup
- Environment configuration
Then I would decide whether Page Objects, fixtures, utilities, or helper functions are appropriate.
However, I would avoid over-engineering.
Simple Rule
Reuse meaningful behavior, not every line of code.
47. How would you decide what should be a reusable fixture?
I would create a fixture when setup or a dependency is:
- Repeated
- Required by multiple tests
- Logically isolated
- Easier to manage centrally
Examples can include:
Authenticated user
Database setup
Test context
Common API client
Reusable test data
Fixtures should make tests simpler, not hide too much logic.
48. How would you handle a test that fails only on one machine?
I would compare the failing machine with a working machine.
I would check:
- Browser version
- Node version
- Playwright version
- OS
- Environment variables
- Network
- Screen size
- Test data
- Time zone
- Dependencies
If it fails only in CI, I would also inspect CI configuration and artifacts.
49. How would you explain the value of Playwright automation to a non-technical manager?
I would avoid technical terminology.
I would explain it like this:
“Playwright allows us to automatically repeat important customer journeys. Instead of a QA engineer manually checking the same scenarios after every release, automation can execute those checks quickly and provide evidence when something fails.”
Then I would connect automation to business benefits:
- Faster regression
- Earlier defect detection
- Better release confidence
- Reduced repetitive effort
- Cross-browser coverage