UI testing framework that controls browsers over Websocket, keeping one open and often making execution faster and more responsive.

  • Polling driven

Locator Strategies

  1. page.get_by_role() locates elements by explicit/implixit accessibility role + name
  2. page.get_by_text() locates elements by visible text content
  3. page.get_by_label() locates form controls by associated label text
  4. page.get_by_placeholder() locates inputs by placeholder attribute
  5. page.get_by_alt_text() locates elements (usually images) by alt text
  6. page.get_by_title() locates elements by title attribute
  7. page.get_by_test_id() locates elements by data-testid (configurable for other attributes)

Assertions

  • Playwright provides expect assertions with auto retries until a timeout

Waiting Strategies

  • Auto-waiting is built into actions
  • We verify actionability before interacting here
  • Before actions like click/type, Playwright automatically waits until the element is ready
  • If its not ready yet, Playwright retires until a timeout
  • Fewer manual waits here, and less boilerplate code This type of waiting is typically more robust than Selenium waiting.