Unit 6: Web Testing Tools - Practice Quiz
1 What is Playwright mainly used for?
2 Which browser engines are supported by Playwright?
3 Which command can create a new Playwright test project?
npm remove playwright@latest and delete every existing test configuration file
npm init playwright@latest
npm build playwright@latest
npm start playwright@latest
4 Which file is commonly used to configure a Playwright Test project?
browser.layout.ts
playwright.config.ts
test.output.ts
playwright.data.ts
5 Which Playwright locator method replaces the existing text in an input field?
screenshot()
fill()
hover()
check()
6
Which Playwright method selects an option from an HTML <select> element?
chooseItem()
setDropdown()
selectEveryMatchingElementFromThePage()
selectOption()
7 Which Playwright method captures an image of the current page?
page.screenshot()
page.snapshotText()
page.captureVideo()
page.printSource()
8 Which screenshot option captures the entire scrollable page in Playwright?
wholeTab: true
fullPage: true
completeBrowserWindowIncludingEveryOpenTab: true
allFrames: true
9 Which Playwright method helps locate elements inside an iframe?
browserLocator()
windowLocator()
frameLocator()
alertLocator()
10 Which Playwright event is commonly awaited when an action opens a new browser tab?
download
request
dialog
page
11 Which Playwright event can be awaited when a page action opens a popup?
responseBodyFromEveryPreviouslyOpenedBrowserWindow
popup
frame
prompt
12 Which method accepts a JavaScript alert or confirmation dialog in Playwright?
dialog.continue()
dialog.select()
dialog.submit()
dialog.accept()
13 Which command runs Playwright tests from the command line?
npx playwright test
npx playwright create
npx playwright configure every installed browser
npx playwright record
14 What is Katalon Studio primarily designed to do?
15 What should a user normally do before installing Katalon Studio?
16 What is the main purpose of a Verify step in a recorded Katalon test?
17 What is Object Spy used for in Katalon Studio?
18 What does a Test Suite contain in Katalon Studio?
19 What is the purpose of a Test Suite Collection in Katalon Studio?
20 What are CSS selectors and XPath expressions used for in Katalon Studio?
21 A test must run the same checkout scenario in Chromium, Firefox, and WebKit. Which Playwright capability is most useful for this requirement?
22 After creating a Node.js project, which command is commonly used to add Playwright along with its test runner and browser setup?
node add playwright browsers
npm install playwright
npm init playwright@latest
npx install playwright
23
A text field may contain an old value when the test starts. Which action reliably replaces the existing value with admin@example.com?
locator.fill("admin@example.com")
locator.press("admin@example.com")
locator.type("Backspace")
locator.click("admin@example.com")
24 A file upload control accepts one PDF file. Which Playwright action should be used to select the file?
page.uploadFile("report.pdf")
locator.selectOption("report.pdf")
locator.fill("report.pdf")
locator.setInputFiles("report.pdf")
25
A native HTML <select> element has an option with value ca. Which statement selects that option?
page.click("#country", "ca")
page.selectOption("#country", "ca")
page.fill("#country", "ca")
page.chooseOption("#country", "ca")
26
A custom dropdown is built from buttons and list items rather than a <select> element. What is the most appropriate approach?
setInputFiles on the menu
selectOption on the container
27 Which Playwright statement captures a screenshot of the entire vertically scrollable page?
await page.capture({ page: "page.png", scroll: true })
await page.screenshot({ path: "page.png" })
await page.fullScreenshot({ path: "page.png" })
await page.screenshot({ path: "page.png", fullPage: true })
28 A test should capture a screenshot only when an assertion fails. Which configuration is most suitable?
use: { screenshot: "only-on-failure" }
use: { screenshot: "on-success" }
use: { screenshot: "never" }
use: { screenshot: "always" }
29
A payment form is inside an iframe with the name payment-frame. Which locator correctly targets the card number field inside it?
page.iframe("payment-frame").fill("#card-number")
page.frameLocator("iframe[name=payment-frame]").locator("#card-number")
page.locator("payment-frame #card-number")
page.locator("#card-number")
30 A frame is dynamically created and identified by its URL. Which approach is best for interacting with it?
page.popup({ url: /checkout/ })
page.frame({ url: /checkout/ })
page.window({ url: /checkout/ })
page.context({ url: /checkout/ })
31 Clicking a button opens a new tab. Which pattern waits for the new page while performing the click?
const tab = await page.waitForEvent("page"); await page.click("#open")
const tab = await page.newPage(); await page.click("#open")
const tab = await Promise.all([page.waitForEvent("popup"), page.click("#open")])
const tab = await Promise.all([context.waitForEvent("page"), page.click("#open")])
32 A link opens a popup window. Which event should be awaited from the originating page before clicking the link?
page.waitForEvent("download")
page.waitForEvent("worker")
page.waitForEvent("dialog")
page.waitForEvent("popup")
33 A page displays a confirmation dialog after clicking Delete. The test should accept it automatically. Which handler is appropriate?
page.on("popup", popup => popup.accept())
page.on("alert", alert => alert.close())
page.on("dialog", dialog => dialog.accept())
page.on("confirm", confirm => confirm.submit())
34 A prompt dialog asks for a username. Which call both supplies the value and submits the dialog?
dialog.submit("alex")
dialog.dismiss("alex")
dialog.accept("alex")
dialog.fill("alex")
35 Which command runs the Playwright test suite in headed mode so that the browser UI is visible?
node playwright test --show
npx playwright test --headed
npm playwright test --browser-ui
npx playwright run --visible
36
A developer wants to execute only tests whose titles contain checkout. Which command provides that filtering?
npx playwright test --filter-title checkout
npx playwright test --grep checkout
npx playwright test --match-file checkout
npx playwright test --name checkout
37 What is the main purpose of Katalon Studio's Object Repository in a web testing project?
38 Before installing Katalon Studio, which prerequisite is most important to verify?
39
During Katalon recording, the tester wants to confirm that a successful login displays the text Welcome. Which verify action best represents this check?
40 A recorded test breaks because a button's generated class changes between builds. How can Object Spy improve the object definition?
41 A test must run the same scenario against Chromium, Firefox, and WebKit while preserving isolated cookies, local storage, and permissions for each run. Which Playwright design best satisfies this requirement?
42 A Playwright project must run Chromium tests in CI, retain traces only after failures, and execute tests in parallel locally but serially in CI. Which configuration strategy is most appropriate?
workers and trace, with browser installation in CI setup
workers: 1 globally and disable tracing for every run
43 An input is initially disabled and becomes enabled after an asynchronous validation request. Which approach most reliably enters text without introducing a race condition?
pressSequentially() while the input remains disabled
page.locator('input').fill() immediately after navigation
fill()
waitForTimeout() and then call fill() on the input
44 A file upload control accepts multiple files and the test must verify that both files were selected before submitting. Which sequence is most reliable?
inputValue(), and submit the form
setInputFiles(), then verify the file input state
45
A native <select> contains duplicate visible labels but unique value attributes, and the selected option triggers asynchronous content loading. Which strategy is most deterministic?
46 A custom dropdown is rendered as a button and a listbox only after the button is clicked. Which locator approach best handles this structure?
selectOption() on the button element
:hover selector to reveal the listbox
47 A failure report must show the entire page, including content below the viewport, while masking a dynamic customer identifier. Which Playwright operation is most suitable?
fullPage: false and blur the image later
fullPage: true and provide the identifier locator in mask
48 A visual regression test should fail only when the rendered screenshot differs meaningfully, while allowing minor antialiasing variation. Which assertion is appropriate?
toHaveScreenshot() with a configured pixel threshold
49 An iframe is recreated after every form submission, so a previously stored frame reference becomes invalid. Which approach best prevents stale-frame failures?
50 A page contains two same-origin iframes with identical internal button text. How should the test click the button in the second iframe without ambiguity?
page.locator('iframe button').nth(1)
page.locator('button').nth(1) from the top-level page
page.frameLocator('iframe').nth(1).getByRole('button', { name: 'Submit' })
page.getByText('Submit').nth(1)
51 Clicking a link opens a new tab, and the test must avoid missing the event due to scheduling order. Which pattern is correct?
Promise.all()
page.bringToFront() before registering the event listener
context.waitForEvent('page')
page.waitForLoadState() before clicking the link
52 A click opens a popup that navigates twice before displaying a confirmation heading. Which synchronization strategy is most reliable?
53 A button triggers a confirmation dialog, and the test must accept it while verifying the message. What must happen relative to the click?
54 A test passes alone but fails in parallel because another test changes shared server data. Which correction best preserves parallel execution without hiding the defect?
55 A CI pipeline should retry transient failures, preserve diagnostics for the first failure, and avoid masking deterministic defects. Which configuration is most suitable?
56 A team needs both keyword-driven authoring for analysts and script-level control for complex conditional workflows. Which Katalon Studio capability best supports this requirement?
57 A Katalon project runs on developers' machines but fails in a clean CI agent because browsers and project dependencies are unavailable. Which setup is most correct?
58 A recorded Katalon test must confirm that a success message appears and that an order total equals the expected value. Which design gives the strongest verification?
59
Object Spy captures a dynamic element whose generated ID changes on every execution, but its stable data-testid attribute remains constant. What is the best maintenance decision?
data-testid property
60 A Katalon test suite contains login, checkout, and reporting tests, but checkout depends on successful login state. Which suite design minimizes hidden ordering assumptions?
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →