Unit 6: Web Testing Tools - Practice Quiz

CSE377 — Web Automation Testing 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is Playwright mainly used for?

Introduction to Playwright tool Easy
A. Editing digital photographs
B. Automating web browser testing
C. Managing network hardware
D. Designing database schemas

2 Which browser engines are supported by Playwright?

Introduction to Playwright tool Easy
A. Internet Explorer only
B. Chromium, Firefox, and WebKit
C. Chromium and Firefox only
D. WebKit and Opera only

3 Which command can create a new Playwright test project?

Installation and configuration of Playwright Easy
A. npm remove playwright@latest and delete every existing test configuration file
B. npm init playwright@latest
C. npm build playwright@latest
D. npm start playwright@latest

4 Which file is commonly used to configure a Playwright Test project?

Installation and configuration of Playwright Easy
A. browser.layout.ts
B. playwright.config.ts
C. test.output.ts
D. playwright.data.ts

5 Which Playwright locator method replaces the existing text in an input field?

Handling Inputs Easy
A. screenshot()
B. fill()
C. hover()
D. check()

6 Which Playwright method selects an option from an HTML <select> element?

Handling Dropdowns Easy
A. chooseItem()
B. setDropdown()
C. selectEveryMatchingElementFromThePage()
D. selectOption()

7 Which Playwright method captures an image of the current page?

Capturing Screenshots Easy
A. page.screenshot()
B. page.snapshotText()
C. page.captureVideo()
D. page.printSource()

8 Which screenshot option captures the entire scrollable page in Playwright?

Capturing Screenshots Easy
A. wholeTab: true
B. fullPage: true
C. completeBrowserWindowIncludingEveryOpenTab: true
D. allFrames: true

9 Which Playwright method helps locate elements inside an iframe?

Handle Frames and iFrames Easy
A. browserLocator()
B. windowLocator()
C. frameLocator()
D. alertLocator()

10 Which Playwright event is commonly awaited when an action opens a new browser tab?

Handling Windows, Tabs and Popups Easy
A. download
B. request
C. dialog
D. page

11 Which Playwright event can be awaited when a page action opens a popup?

Handling Windows, Tabs and Popups Easy
A. responseBodyFromEveryPreviouslyOpenedBrowserWindow
B. popup
C. frame
D. prompt

12 Which method accepts a JavaScript alert or confirmation dialog in Playwright?

Handling Alerts in Playwright Easy
A. dialog.continue()
B. dialog.select()
C. dialog.submit()
D. dialog.accept()

13 Which command runs Playwright tests from the command line?

Running Playwright Tests Easy
A. npx playwright test
B. npx playwright create
C. npx playwright configure every installed browser
D. npx playwright record

14 What is Katalon Studio primarily designed to do?

Introduction to Katalon Studio Easy
A. Compile operating system kernels
B. Configure physical network switches
C. Design three-dimensional models
D. Create and run automated tests

15 What should a user normally do before installing Katalon Studio?

Installing Katalon Studio Easy
A. Build the source code
B. Replace the computer's operating system with a server-only edition
C. Create a browser extension
D. Download the suitable installer

16 What is the main purpose of a Verify step in a recorded Katalon test?

Writing test case using Katalon Recording with Verify Options Easy
A. Check an expected condition
B. Delete the recorded actions
C. Install a web browser
D. Open a new project

17 What is Object Spy used for in Katalon Studio?

Work with Object Spy Easy
A. Schedule operating system updates
B. Measure network cable length
C. Inspect and capture test objects
D. Generate a complete application without examining any user interface elements

18 What does a Test Suite contain in Katalon Studio?

Create Test Suite Easy
A. A set of browser installers
B. A group of test cases
C. A list of user passwords
D. A collection of operating systems

19 What is the purpose of a Test Suite Collection in Katalon Studio?

Create Test Suite Collection Easy
A. Convert every manual test into application source code automatically
B. Store individual web elements
C. Record a single browser action
D. Run multiple test suites

20 What are CSS selectors and XPath expressions used for in Katalon Studio?

Use CSS and XPath in Katalon Studio Easy
A. Locating web page elements
B. Installing testing plugins
C. Changing the computer's network settings
D. Creating test execution reports

21 A test must run the same checkout scenario in Chromium, Firefox, and WebKit. Which Playwright capability is most useful for this requirement?

Introduction to Playwright tool Medium
A. Browser-specific test projects
B. One locator for every browser
C. A screenshot after each action
D. A single fixed browser context

22 After creating a Node.js project, which command is commonly used to add Playwright along with its test runner and browser setup?

Installation and configuration of Playwright Medium
A. node add playwright browsers
B. npm install playwright
C. npm init playwright@latest
D. 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?

Handling Inputs Medium
A. locator.fill("admin@example.com")
B. locator.press("admin@example.com")
C. locator.type("Backspace")
D. locator.click("admin@example.com")

24 A file upload control accepts one PDF file. Which Playwright action should be used to select the file?

Handling Inputs Medium
A. page.uploadFile("report.pdf")
B. locator.selectOption("report.pdf")
C. locator.fill("report.pdf")
D. locator.setInputFiles("report.pdf")

25 A native HTML <select> element has an option with value ca. Which statement selects that option?

Handling Dropdowns Medium
A. page.click("#country", "ca")
B. page.selectOption("#country", "ca")
C. page.fill("#country", "ca")
D. 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?

Handling Dropdowns Medium
A. Use setInputFiles on the menu
B. Click the control and then the desired item
C. Use selectOption on the container
D. Set the option through an input value

27 Which Playwright statement captures a screenshot of the entire vertically scrollable page?

Capturing Screenshots Medium
A. await page.capture({ page: "page.png", scroll: true })
B. await page.screenshot({ path: "page.png" })
C. await page.fullScreenshot({ path: "page.png" })
D. 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?

Capturing Screenshots Medium
A. use: { screenshot: "only-on-failure" }
B. use: { screenshot: "on-success" }
C. use: { screenshot: "never" }
D. 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?

Handle Frames and iFrames Medium
A. page.iframe("payment-frame").fill("#card-number")
B. page.frameLocator("iframe[name=payment-frame]").locator("#card-number")
C. page.locator("payment-frame #card-number")
D. page.locator("#card-number")

30 A frame is dynamically created and identified by its URL. Which approach is best for interacting with it?

Handle Frames and iFrames Medium
A. Use page.popup({ url: /checkout/ })
B. Use page.frame({ url: /checkout/ })
C. Use page.window({ url: /checkout/ })
D. Use page.context({ url: /checkout/ })

31 Clicking a button opens a new tab. Which pattern waits for the new page while performing the click?

Handling Windows, Tabs and Popups Medium
A. const tab = await page.waitForEvent("page"); await page.click("#open")
B. const tab = await page.newPage(); await page.click("#open")
C. const tab = await Promise.all([page.waitForEvent("popup"), page.click("#open")])
D. 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?

Handling Windows, Tabs and Popups Medium
A. page.waitForEvent("download")
B. page.waitForEvent("worker")
C. page.waitForEvent("dialog")
D. page.waitForEvent("popup")

33 A page displays a confirmation dialog after clicking Delete. The test should accept it automatically. Which handler is appropriate?

Handling Alerts in Playwright Medium
A. page.on("popup", popup => popup.accept())
B. page.on("alert", alert => alert.close())
C. page.on("dialog", dialog => dialog.accept())
D. page.on("confirm", confirm => confirm.submit())

34 A prompt dialog asks for a username. Which call both supplies the value and submits the dialog?

Handling Alerts in Playwright Medium
A. dialog.submit("alex")
B. dialog.dismiss("alex")
C. dialog.accept("alex")
D. dialog.fill("alex")

35 Which command runs the Playwright test suite in headed mode so that the browser UI is visible?

Running Playwright Tests Medium
A. node playwright test --show
B. npx playwright test --headed
C. npm playwright test --browser-ui
D. npx playwright run --visible

36 A developer wants to execute only tests whose titles contain checkout. Which command provides that filtering?

Running Playwright Tests Medium
A. npx playwright test --filter-title checkout
B. npx playwright test --grep checkout
C. npx playwright test --match-file checkout
D. npx playwright test --name checkout

37 What is the main purpose of Katalon Studio's Object Repository in a web testing project?

Introduction to Katalon Studio Medium
A. Generate production application code
B. Store only execution result screenshots
C. Store reusable test object definitions
D. Replace the browser installation process

38 Before installing Katalon Studio, which prerequisite is most important to verify?

Installing Katalon Studio Medium
A. The operating system meets supported requirements
B. A web page is already open
C. A test suite has been recorded
D. The application has a database schema

39 During Katalon recording, the tester wants to confirm that a successful login displays the text Welcome. Which verify action best represents this check?

Writing test case using Katalon Recording with Verify Options Medium
A. Verify the text of the welcome element
B. Verify the test case file name
C. Verify the browser window size
D. Verify the recorder toolbar state

40 A recorded test breaks because a button's generated class changes between builds. How can Object Spy improve the object definition?

Work with Object Spy Medium
A. Replace the object with a screenshot
B. Add a stable attribute to the selector
C. Remove all selector properties
D. Record the button only during execution

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?

Introduction to Playwright tool Hard
A. Create one browser context per project and pages within each context
B. Create one browser context and switch its browser engine dynamically
C. Create one browser and reuse one page for every project
D. Create one page per project while sharing the default context

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?

Installation and configuration of Playwright Hard
A. Install browsers manually and control all behavior inside test bodies
B. Use environment-based workers and trace, with browser installation in CI setup
C. Create a separate test file for each worker and collect screenshots manually
D. Set 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?

Handling Inputs Hard
A. Use pressSequentially() while the input remains disabled
B. Call page.locator('input').fill() immediately after navigation
C. Wait for the locator to be enabled, then call fill()
D. Use 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?

Handling Inputs Hard
A. Attach files through keyboard events and trust the browser dialog
B. Set the files, inspect inputValue(), and submit the form
C. Click the input twice and type each absolute path separately
D. Set both files with 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?

Handling Dropdowns Hard
A. Click the second matching text node and continue immediately
B. Select by visible label and wait for a fixed delay
C. Type the option text and assume the change event fired
D. Select by unique value and assert the dependent content afterward

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?

Handling Dropdowns Hard
A. Click the button, then choose an option by role and accessible name
B. Use selectOption() on the button element
C. Use a CSS :hover selector to reveal the listbox
D. Locate the hidden list item and force-click it before opening the menu

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?

Capturing Screenshots Hard
A. Capture the viewport with fullPage: false and blur the image later
B. Capture only the identifier element and omit the rest of the page
C. Capture the viewport repeatedly and concatenate images in test code
D. Capture with 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?

Capturing Screenshots Hard
A. Use toHaveScreenshot() with a configured pixel threshold
B. Compare the screenshot path strings returned by the test
C. Check only that the screenshot file exists
D. Compare screenshot file sizes exactly

49 An iframe is recreated after every form submission, so a previously stored frame reference becomes invalid. Which approach best prevents stale-frame failures?

Handle Frames and iFrames Hard
A. Force-click the iframe element and assume its document is unchanged
B. Store the frame object globally before the test starts
C. Use page-level selectors that ignore the iframe boundary
D. Use a frame locator tied to the iframe locator and locate descendants lazily

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?

Handle Frames and iFrames Hard
A. Use page.locator('iframe button').nth(1)
B. Use page.locator('button').nth(1) from the top-level page
C. Use page.frameLocator('iframe').nth(1).getByRole('button', { name: 'Submit' })
D. Use 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?

Handling Windows, Tabs and Popups Hard
A. Start waiting for the page event and click concurrently with Promise.all()
B. Use page.bringToFront() before registering the event listener
C. Click first, then call context.waitForEvent('page')
D. Call 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?

Handling Windows, Tabs and Popups Hard
A. Wait for the popup event, then assert the final heading on the popup page
B. Wait for one fixed URL immediately after the click
C. Sleep for several seconds and use the original page object
D. Count open browser tabs and select the last page without assertions

53 A button triggers a confirmation dialog, and the test must accept it while verifying the message. What must happen relative to the click?

Handling Alerts in Playwright Hard
A. Register the dialog handler before clicking and assert its message
B. Use a locator assertion because dialogs are DOM elements
C. Dismiss all dialogs globally before the test begins
D. Register the dialog handler after clicking the button

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?

Running Playwright Tests Hard
A. Give each test isolated data or mark only the shared fixture as serial
B. Add random delays before every data-modifying action
C. Increase the global timeout for all tests
D. Disable all assertions in the affected test

55 A CI pipeline should retry transient failures, preserve diagnostics for the first failure, and avoid masking deterministic defects. Which configuration is most suitable?

Running Playwright Tests Hard
A. Use retries only locally and ignore failed CI artifacts
B. Use a small retry count with failure tracing and inspect retry reports
C. Use unlimited retries and disable traces to reduce output
D. Rerun every test manually until the pipeline passes

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?

Introduction to Katalon Studio Hard
A. Use the dual interfaces of manual steps and script-based test cases
B. Use only manual test cases and export them as screenshots
C. Create one test suite for each programming language
D. Replace all recorded actions with browser extensions

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?

Installing Katalon Studio Hard
A. Copy a developer's browser profile into the CI workspace
B. Install Katalon, provision supported browsers, and restore project dependencies
C. Install only the Katalon executable and rely on cached user profiles
D. Run the project without configuring the execution environment

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?

Writing test case using Katalon Recording with Verify Options Hard
A. Verify only that the submit button was clicked successfully
B. Record clicks only and infer success from the final URL
C. Add a visible-text verification and a value verification for the total
D. Insert a delay after checkout and verify that the browser remains open

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?

Work with Object Spy Hard
A. Use an absolute XPath containing the full DOM hierarchy
B. Replace the ID locator with the stable data-testid property
C. Keep the generated ID because it was captured first
D. Add a longer delay so the generated ID becomes stable

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?

Create Test Suite Hard
A. Make each test establish its own required state or use controlled setup
B. Remove login assertions because checkout will validate the session
C. Place all tests in one suite and rely on their file order
D. Run checkout first so login failures appear earlier