UI testing framework that controls browsers over Websocket, keeping one open and often making execution faster and more responsive.
- Polling driven
Locator Strategies
page.get_by_role()locates elements by explicit/implixit accessibility role + namepage.get_by_text()locates elements by visible text contentpage.get_by_label()locates form controls by associated label textpage.get_by_placeholder()locates inputs by placeholder attributepage.get_by_alt_text()locates elements (usually images) by alt textpage.get_by_title()locates elements by title attributepage.get_by_test_id()locates elements by data-testid (configurable for other attributes)
Assertions
- Playwright provides
expectassertions 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.