Chapter 13: Objects and properties
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Objects and properties
Objects group related named properties. Dot notation reads a known property; bracket notation can use a dynamic property name. Test data often contains objects describing users, products or environments.
How it works
Step-by-step walkthrough
- Create a user object
- Access a property
- Read a dynamic key
Example
const user = { name: 'Learner', role: 'QA' };
const key = 'role';
console.log(user.name, user[key]);Do not put real credentials into source-controlled test data.
✎ Your practice task
Add an active property with value true.
Knowledge check
How do you access a dynamic key variable?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.