Sample questions
Ta Framework Architecture PatternsDifficulty 1
In the Page Object Model (POM), what is the main responsibility of a page object class?
- aStoring the CI pipeline configuration for the test run
- bEncapsulating a page's locators and interactions behind methods the tests call✓
- cRecording video artifacts of every test execution
- dAggregating pass/fail counts and generating an HTML or JUnit-style report after the suite finishes
Explanation:A page object wraps a page's locators and the actions you can perform on it (e.g. login(), search()) so tests call meaningful methods instead of touching selectors directly; that is exactly (b). CI config (a), video recording (c) and reporting (d) are unrelated concerns handled elsewhere in the framework.
Ta Framework Architecture PatternsDifficulty 1
Why do teams introduce the Page Object Model instead of putting raw locators directly inside test methods?
- aSo that a UI change only requires updating the page object, not every test that uses that page✓
- bSo that tests run in parallel automatically without any extra configuration
- cSo that the browser starts faster during test execution
- dSo that test data created during setup no longer needs to be cleaned up or reset between separate test runs
Explanation:POM centralizes locators in one place; if the UI changes, only the page object needs updating instead of every test that touches that element, which is (a). Parallel execution (b), browser startup speed (c), and data cleanup (d) are separate concerns that POM does not address.
Ta Framework Architecture PatternsDifficulty 1
In a Cypress beforeEach hook that runs before every test in a spec file, which of these is the most appropriate use?
- aAsserting the final expected result of the last test in the file
- bDeleting the entire test file after the suite completes
- cVisiting the starting URL and logging in so every test begins from a known state✓
- dPrinting the final line and branch code coverage percentage collected for the whole project
Explanation:beforeEach runs before every test, so it is the right place for setup that every test needs, such as navigating to a URL and authenticating (c). Asserting a final result (a) belongs inside a test itself, deleting the spec file (b) makes no sense as setup, and coverage reporting (d) is a separate tooling concern, not a per-test hook responsibility.
Ta Framework Architecture PatternsDifficulty 2
What problem does test data isolation try to prevent between automated tests?
- aTests taking an unreasonably long time to compile or transpile before execution even starts
- bThe test runner failing to detect installed browsers
- cScreenshots not being saved on failure
- dOne test's leftover data or state affecting the outcome of another test✓
Explanation:Test data isolation ensures each test creates and cleans up its own data (or uses uniquely scoped data) so that one test's side effects cannot change another test's result, matching (d). Compile time (a), browser detection (b) and screenshot saving (c) are unrelated to data isolation.
Ta Framework Architecture PatternsDifficulty 2
In Playwright's test framework, what is a "fixture" primarily used for?
- aProviding a reusable, pre-configured object (like a page or authenticated context) that tests declare as a parameter✓
- bCompressing video recordings after a test run finishes
- cConverting test results into a JUnit XML file
- dBlocking outgoing network requests to third-party analytics and advertising domains during the test run
Explanation:Playwright fixtures supply reusable setup — such as a page or a pre-authenticated context — that a test function receives as a parameter, matching (a). Video compression (b), JUnit conversion (c) and network blocking (d) may exist in a framework but are not what fixtures are for.
Ta Framework Architecture PatternsDifficulty 2
A junior engineer writes a test that clicks a button using a locator copy-pasted directly into three different test files, instead of putting it in a page object. What is the main risk of this approach?
- aThe test will run measurably slower every time because the same locator string is being parsed and duplicated
- bThe browser will fail to launch when the same locator string appears twice
- cIf the button's selector changes, all three test files must be updated individually✓
- dCypress will refuse to execute the test because of duplicate locator strings
Explanation:Duplicating a raw locator across files means any future change to that selector has to be hunted down and fixed in every copy, which is exactly the maintenance risk (c) that page objects exist to remove. Locator duplication does not affect run speed (a), does not stop a browser launching (b), and Cypress does not reject duplicate strings (d).