41. How would you handle environment-specific URLs and credentials?

I would avoid hardcoding them inside test files.

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:

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:

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:

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:

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:

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:


Pages: 1 2 3 4 5 6

Leave a Reply

Your email address will not be published. Required fields are marked *