Playwright Testing Practice Questions: Roadmap-Wise Sheets
One practice sheet for every step of the Playwright Testing roadmap. Click a sheet card to open its topics, then practise the questions.
1Sheet 1: JavaScript / TypeScript
Weeks 1–2 · 4 topicsClick to open topics ▾
Sheet 1: JavaScript / TypeScript
Weeks 1–2 · 4 topics
Practise: Variables & functions · 12 questionsEasy
- What are arrow functions? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
A short function syntax that does not have its own this and arguments, taking them from the surrounding scope. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are arrow functions? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
A short function syntax that does not have its own this and arguments, taking them from the surrounding scope. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are arrow functions? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
A short function syntax that does not have its own this and arguments, taking them from the surrounding scope. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are arrow functions?
Show answer
A short function syntax that does not have its own this and arguments, taking them from the surrounding scope. - What are closures? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
A function that remembers variables from its outer scope even after that scope has finished. They are used for private state and factory helpers. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are higher-order functions? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Functions that take other functions as arguments or return them, such as map, filter and reduce, or a helper that wraps retry logic around a test step. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are closures? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
A function that remembers variables from its outer scope even after that scope has finished. They are used for private state and factory helpers. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are higher-order functions? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
Functions that take other functions as arguments or return them, such as map, filter and reduce, or a helper that wraps retry logic around a test step. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are closures? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
A function that remembers variables from its outer scope even after that scope has finished. They are used for private state and factory helpers. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are higher-order functions? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Functions that take other functions as arguments or return them, such as map, filter and reduce, or a helper that wraps retry logic around a test step. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are closures?
Show answer
A function that remembers variables from its outer scope even after that scope has finished. They are used for private state and factory helpers. - What are closures?
Show answer
A function that remembers variables from its outer scope even after that scope has finished. They are used for private state and factory helpers.
Practise: Async / await · 12 questionsEasy
- What is async/await? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is async/await?
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. - What is async/await?
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step. - What is async/await?
Show answer
Syntax over Promises: an async function returns a Promise and await pauses until it resolves. Every Playwright action returns a Promise, so you await each step.
Practise: Promises · 12 questionsMedium
- Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Promise.all vs Promise.allSettled vs Promise.race?
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. - Promise.all vs Promise.allSettled vs Promise.race?
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. - Promise.all vs Promise.allSettled vs Promise.race?
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish. - Promise.all vs Promise.allSettled vs Promise.race?
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish.
Practise: TypeScript types · 12 questionsMedium
- What is the difference between TypeScript and JavaScript? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
TypeScript adds static types on top of JavaScript and compiles to it. Types catch errors early and give better autocomplete, which helps in larger test suites. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between TypeScript and JavaScript? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
TypeScript adds static types on top of JavaScript and compiles to it. Types catch errors early and give better autocomplete, which helps in larger test suites. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between TypeScript and JavaScript? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
TypeScript adds static types on top of JavaScript and compiles to it. Types catch errors early and give better autocomplete, which helps in larger test suites. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between a type and an enum in TypeScript? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
A type alias describes a shape or union of values; an enum creates a named set of constants that exists at runtime. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are interfaces and types in TypeScript? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
Both describe the shape of data. Interfaces are extendable and suit object contracts; type aliases can also model unions and primitives. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - interface vs type in TypeScript? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Both describe object shapes. Interfaces can be extended and merged; type aliases can also describe unions and primitives. Use interfaces for page or test-data shapes, types for unions. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are interfaces and types in TypeScript? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
Both describe the shape of data. Interfaces are extendable and suit object contracts; type aliases can also model unions and primitives. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are interfaces and types in TypeScript? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Both describe the shape of data. Interfaces are extendable and suit object contracts; type aliases can also model unions and primitives. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are generics in TypeScript?
Show answer
Placeholders for types that make reusable code type-safe, for example a helper function returning the same type of item that it receives. - How would you type the response of an API call in TypeScript? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Define an interface for the payload, cast or validate the parsed JSON to it (for example with zod), and use that type in assertions to catch shape changes. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you type the response of an API call in TypeScript? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
Define an interface for the payload, cast or validate the parsed JSON to it (for example with zod), and use that type in assertions to catch shape changes. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you type the response of an API call in TypeScript? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Define an interface for the payload, cast or validate the parsed JSON to it (for example with zod), and use that type in assertions to catch shape changes. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures.
2Sheet 2: Playwright Fundamentals
Weeks 3–4 · 4 topicsClick to open topics ▾
Sheet 2: Playwright Fundamentals
Weeks 3–4 · 4 topics
Practise: Setup & config · 13 questionsEasy
- How do you install and start a Playwright project? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Run npm init playwright@latest, which sets up config, example tests and browsers; execute with npx playwright test. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you install and start a Playwright project? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Run npm init playwright@latest, which sets up config, example tests and browsers; execute with npx playwright test. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you take screenshots and videos? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
page.screenshot() for captures and config options use: { screenshot: 'only-on-failure', video: 'retain-on-failure' } for automatic evidence. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on mobile viewports? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on mobile viewports? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you take screenshots and videos? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
page.screenshot() for captures and config options use: { screenshot: 'only-on-failure', video: 'retain-on-failure' } for automatic evidence. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you take screenshots and videos? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
page.screenshot() for captures and config options use: { screenshot: 'only-on-failure', video: 'retain-on-failure' } for automatic evidence. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you take screenshots and videos? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
page.screenshot() for captures and config options use: { screenshot: 'only-on-failure', video: 'retain-on-failure' } for automatic evidence. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on mobile viewports? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on mobile viewports? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on mobile viewports? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you handle a very flaky element that appears after an animation? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
Rely on auto-waiting plus a web-first assertion on the final state, disable animations in config for tests and avoid fixed timeouts. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you handle a very flaky element that appears after an animation? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
Rely on auto-waiting plus a web-first assertion on the final state, disable animations in config for tests and avoid fixed timeouts. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures.
Practise: Locators (getByRole) · 13 questionsEasy
- Which locators does Playwright recommend? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Which locators does Playwright recommend?
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. - Which locators does Playwright recommend?
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. - Which locators does Playwright recommend?
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath. - Which locators does Playwright recommend?
Show answer
User-facing ones: getByRole, getByText, getByLabel, getByPlaceholder and getByTestId, which are more resilient than CSS or XPath.
Practise: Auto-waiting · 13 questionsMedium
- What is auto-waiting in Playwright? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is auto-waiting in Playwright?
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. - What is auto-waiting in Playwright?
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed. - What is auto-waiting in Playwright?
Show answer
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed.
Practise: Assertions · 13 questionsMedium
- What are soft assertions? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are soft assertions? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are soft assertions? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are soft assertions? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are soft assertions? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are soft assertions? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
await expect.soft(locator).toHaveText('...') records the failure but lets the test continue, so you see every mismatch in one run. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are web-first assertions?
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks. - What are web-first assertions?
Show answer
Assertions like expect(locator).toBeVisible() that retry until they pass or time out, unlike one-off checks.
3Sheet 3: Advanced Playwright
Weeks 5–6 · 4 topicsClick to open topics ▾
Sheet 3: Advanced Playwright
Weeks 5–6 · 4 topics
Practise: Fixtures · 13 questionsEasy
- What are fixtures and how do you create a custom one? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Fixtures set up and tear down test dependencies. Extend with test.extend({ loggedInPage: async ({ page }, use) => { ...; await use(page); } }). Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between beforeEach and fixtures? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
beforeEach runs the same code before every test in scope; fixtures are lazy, composable and only set up what a test uses. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures and how do you create a custom one? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Fixtures set up and tear down test dependencies. Extend with test.extend({ loggedInPage: async ({ page }, use) => { ...; await use(page); } }). Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures in Playwright? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Write an API test with the request fixture. Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
test('get user', async ({ request }) => { const res = await request.get('/api/users/1'); expect(res.ok()).toBeTruthy(); expect((await res.json()).id).toBe(1); }); Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Write an API test with the request fixture. Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
test('get user', async ({ request }) => { const res = await request.get('/api/users/1'); expect(res.ok()).toBeTruthy(); expect((await res.json()).id).toBe(1); }); Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures in Playwright? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures in Playwright? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures in Playwright? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Write an API test with the request fixture. Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
test('get user', async ({ request }) => { const res = await request.get('/api/users/1'); expect(res.ok()).toBeTruthy(); expect((await res.json()).id).toBe(1); }); Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between beforeEach and fixtures? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
beforeEach runs the same code before every test in scope; fixtures are lazy, composable and only set up what a test uses. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What are fixtures in Playwright?
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage. - What are fixtures in Playwright?
Show answer
Reusable setup/teardown units injected into tests (page, context, request). You can extend test with custom fixtures such as loggedInPage.
Practise: Network mocking · 13 questionsEasy
- How do you mock network requests? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
page.route('**/api/items', route => route.fulfill({ json: [...] })) intercepts and replies with test data; route.abort() simulates failures. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you debug a Playwright test? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
Use --debug or the Inspector, page.pause(), UI mode, the trace viewer and headed runs with slowMo. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you wait for a network response in Playwright? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
Use page.waitForResponse(res => res.url().includes('/api/orders') && res.ok()) together with the action that triggers it. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you wait for a network response in Playwright? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
Use page.waitForResponse(res => res.url().includes('/api/orders') && res.ok()) together with the action that triggers it. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is the difference between click and dispatchEvent? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
click simulates a real user click with actionability checks; dispatchEvent fires a DOM event directly without those checks. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you test file downloads and verify their content? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
Capture the download event, save it with download.saveAs, then read the file in Node and assert on name, size or content. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you perform drag and drop and hover? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
locator.hover() and locator.dragTo(target) perform these actions, with auto-waiting for actionability. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you test geolocation, permissions and time zones? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
Set them in the context options (geolocation, permissions, timezoneId, locale) to simulate users from other regions. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you wait for a network response in Playwright?
Show answer
Use page.waitForResponse(res => res.url().includes('/api/orders') && res.ok()) together with the action that triggers it. - How do you mock network requests?
Show answer
page.route('**/api/items', route => route.fulfill({ json: [...] })) intercepts and replies with test data; route.abort() simulates failures. - How do you mock network requests?
Show answer
page.route('**/api/items', route => route.fulfill({ json: [...] })) intercepts and replies with test data; route.abort() simulates failures. - How do you mock network requests?
Show answer
page.route('**/api/items', route => route.fulfill({ json: [...] })) intercepts and replies with test data; route.abort() simulates failures. - How do you wait for a network response in Playwright?
Show answer
Use page.waitForResponse(res => res.url().includes('/api/orders') && res.ok()) together with the action that triggers it.
Practise: Tabs & frames · 13 questionsMedium
- How do you work with iframes? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
const frame = page.frameLocator('#payment-frame'); await frame.getByLabel('Card number').fill('4111 1111 1111 1111'); Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you work with iframes? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
const frame = page.frameLocator('#payment-frame'); await frame.getByLabel('Card number').fill('4111 1111 1111 1111'); Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you work with iframes? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
const frame = page.frameLocator('#payment-frame'); await frame.getByLabel('Card number').fill('4111 1111 1111 1111'); Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you work with iframes?
Show answer
const frame = page.frameLocator('#payment-frame'); await frame.getByLabel('Card number').fill('4111 1111 1111 1111'); - How do you work with iframes?
Show answer
const frame = page.frameLocator('#payment-frame'); await frame.getByLabel('Card number').fill('4111 1111 1111 1111'); - How do you handle multiple tabs or pop-ups? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
Wait for the popup event with const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('a')]), then interact with popup. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle iframes in Playwright? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
Use page.frameLocator('#frame').getByRole(...) so actions work inside the iframe with auto-waiting. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle multiple tabs or pop-ups? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
Wait for the popup event with const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('a')]), then interact with popup. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle iframes in Playwright? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Use page.frameLocator('#frame').getByRole(...) so actions work inside the iframe with auto-waiting. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle multiple tabs or pop-ups? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
Wait for the popup event with const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('a')]), then interact with popup. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle multiple tabs or pop-ups? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
Wait for the popup event with const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('a')]), then interact with popup. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle multiple tabs or pop-ups?
Show answer
Wait for the popup event with const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('a')]), then interact with popup. - How do you handle iframes in Playwright?
Show answer
Use page.frameLocator('#frame').getByRole(...) so actions work inside the iframe with auto-waiting.
Practise: Upload / download · 13 questionsMedium
- How do you handle file uploads and downloads? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you handle file uploads and downloads?
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. - How do you handle file uploads and downloads?
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file. - How do you handle file uploads and downloads?
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file.
4Sheet 4: Framework Design
Weeks 7–8 · 4 topicsClick to open topics ▾
Sheet 4: Framework Design
Weeks 7–8 · 4 topics
Practise: Page Object Model · 13 questionsEasy
- How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you organise tests with page object model in Playwright?
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. - How do you organise tests with page object model in Playwright?
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests. - How do you organise tests with page object model in Playwright?
Show answer
Create a class that takes a page, defines locators as properties and exposes action methods; instantiate it in a fixture for clean tests.
Practise: Test data · 13 questionsEasy
- How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you reuse login state across tests? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Log in once in global setup, save storageState to a JSON file and set use.storageState in the config so every test starts logged in. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests in parallel and control workers? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Files run in parallel by default; set workers in the config and use test.describe.configure({ mode: 'parallel' }) for tests inside a file. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you shard tests across machines? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Use npx playwright test --shard=1/4 in each CI job and merge reports afterwards to reduce total run time. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you tag and filter tests? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
Add tags in the title (@smoke) or use the tag option, and run with --grep @smoke or --grep-invert. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you do visual regression testing? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
Use expect(page).toHaveScreenshot() to compare with stored baselines, with thresholds and masks for dynamic regions. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests in parallel and control workers? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
Files run in parallel by default; set workers in the config and use test.describe.configure({ mode: 'parallel' }) for tests inside a file. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you manage test data and environments? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Use environment variables or .env files, a baseURL in config, API calls for setup and cleanup, and unique data per run. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you manage test data and environments? Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
Use environment variables or .env files, a baseURL in config, API calls for setup and cleanup, and unique data per run. Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests in parallel and control workers? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Files run in parallel by default; set workers in the config and use test.describe.configure({ mode: 'parallel' }) for tests inside a file. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you manage test data and environments? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Use environment variables or .env files, a baseURL in config, API calls for setup and cleanup, and unique data per run. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you manage test data and environments? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Use environment variables or .env files, a baseURL in config, API calls for setup and cleanup, and unique data per run. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you manage test data and environments?
Show answer
Use environment variables or .env files, a baseURL in config, API calls for setup and cleanup, and unique data per run.
Practise: Environment config · 13 questionsMedium
- How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you structure environment-specific configs in Playwright?
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. - How do you structure environment-specific configs in Playwright?
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. - How do you structure environment-specific configs in Playwright?
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. - How do you structure environment-specific configs in Playwright?
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag. - How do you structure environment-specific configs in Playwright?
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag.
Practise: Parallel & sharding · 13 questionsMedium
- How do you run tests on three browsers in parallel? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests on three browsers in parallel? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Define projects for chromium, firefox and webkit in playwright.config.ts, set workers, then run: npx playwright test Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run tests in parallel and control workers? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Files run in parallel by default; set workers in the config and use test.describe.configure({ mode: 'parallel' }) for tests inside a file. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you reduce the execution time of a 2000-test suite? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
Run in parallel with sharding, reuse authentication state, set up data through APIs, avoid unnecessary waits, run smoke on every commit and the full suite nightly. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you reduce the execution time of a 2000-test suite? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
Run in parallel with sharding, reuse authentication state, set up data through APIs, avoid unnecessary waits, run smoke on every commit and the full suite nightly. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you reduce the execution time of a 2000-test suite? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Run in parallel with sharding, reuse authentication state, set up data through APIs, avoid unnecessary waits, run smoke on every commit and the full suite nightly. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you reduce the execution time of a 2000-test suite?
Show answer
Run in parallel with sharding, reuse authentication state, set up data through APIs, avoid unnecessary waits, run smoke on every commit and the full suite nightly.
5Sheet 5: API & Visual Testing
Week 9 · 3 topicsClick to open topics ▾
Sheet 5: API & Visual Testing
Week 9 · 3 topics
Practise: APIRequestContext · 14 questionsEasy
- What is APIRequestContext? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What is APIRequestContext?
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. - What is APIRequestContext?
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. - What is APIRequestContext?
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context. - What is APIRequestContext?
Show answer
The object behind the request fixture that holds base URL, headers and cookies, and can share cookies with a browser context.
Practise: Visual comparisons · 14 questionsEasy
- How does visual testing work in Playwright? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does visual testing work in Playwright?
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. - How does visual testing work in Playwright?
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. - How does visual testing work in Playwright?
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. - How does visual testing work in Playwright?
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates. - How does visual testing work in Playwright?
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates.
Practise: Trace viewer · 14 questionsMedium
- How does Playwright's trace viewer help? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How does Playwright's trace viewer help?
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. - How does Playwright's trace viewer help?
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. - How does Playwright's trace viewer help?
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. - How does Playwright's trace viewer help?
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened. - How does Playwright's trace viewer help?
Show answer
It records screenshots, DOM snapshots, network calls and actions per step so you can replay a failed run and see exactly what happened.
6Sheet 6: CI/CD & Capstone
Week 10 · 3 topicsClick to open topics ▾
Sheet 6: CI/CD & Capstone
Week 10 · 3 topics
Practise: GitHub Actions · 11 questionsEasy
- How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How do you run Playwright in GitHub Actions?
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact.
Practise: HTML reports · 11 questionsEasy
- What reporters does Playwright provide? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - What reporters does Playwright provide?
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment.
Practise: Capstone framework · 12 questionsMedium
- How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - Design a Playwright framework for a 500-test suite. Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
TypeScript + POM + custom fixtures, environment configs, API helpers for test data, tags like @smoke, sharding across CI machines, retries with traces, HTML/Allure reports, lint and review rules. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures. - How would you structure a large Playwright framework for a team? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Separate tests, page objects, fixtures, utilities, test data and config; use tags, projects, shared auth setup, linting, code review and a CI pipeline with sharding and reports. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, use resilient locators, web-first assertions, isolated test data, deterministic setup, and traces or reports to diagnose failures.