Selenium WebDriver Regulatory Frameworks & Compliance 3 β Questions and Answers
Question 1: A financial institution requires audit trails for all automated test executions. Which Selenium framework feature best supports this requirement?
- Integrating a test listener that logs test start/stop, user agent, and timestamps to an immutable log store (Correct answer)
- Enabling verbose logging in ChromeDriver and storing output in a shared folder
- Using Selenium Grid's built-in audit database
- Recording all test sessions with video and storing them indefinitely
Correct answer: Integrating a test listener that logs test start/stop, user agent, and timestamps to an immutable log store
A test listener that writes structured, tamper-evident logs to an immutable store satisfies financial audit trail requirements by providing verifiable execution records.
Question 2: WCAG 2.1 Success Criterion 2.4.3 requires a logical focus order. How would you verify this with Selenium WebDriver?
- Simulate sequential Tab key presses and assert that focus moves to elements in the expected DOM order (Correct answer)
- Check that all elements have a tabindex attribute greater than 0
- Verify that the CSS z-index property increases for each focusable element
- Use findElements(By.cssSelector(':focus')) after page load to capture all focused elements
Correct answer: Simulate sequential Tab key presses and assert that focus moves to elements in the expected DOM order
Sending repeated Tab key presses via Actions and capturing the focused element each time lets you verify the focus order matches the expected logical sequence.
Question 3: SOC 2 Type II requires evidence of continuous controls. Which Selenium practice provides the strongest evidence for automated testing controls?
- Scheduled CI/CD pipeline execution with signed test reports stored in an audit repository (Correct answer)
- Manual test execution logs reviewed by the QA manager monthly
- Screenshot archives stored in a shared drive with access restricted to QA
- Selenium Grid usage statistics exported from the admin console
Correct answer: Scheduled CI/CD pipeline execution with signed test reports stored in an audit repository
Automated, scheduled pipeline runs with cryptographically signed test reports demonstrate continuous, repeatable controls required for SOC 2 Type II evidence.
Question 4: A GDPR Data Protection Impact Assessment (DPIA) is required when tests process data at scale. Which Selenium Grid scenario most likely triggers a DPIA requirement?
- Running automated tests against a production database snapshot containing real user records (Correct answer)
- Parallelizing tests across 20 Grid nodes using synthetic data
- Capturing screenshots of a login page with no user data visible
- Testing a GDPR cookie consent banner using dummy account credentials
Correct answer: Running automated tests against a production database snapshot containing real user records
Using a production snapshot with real user records in an automated test environment constitutes large-scale processing of personal data, which triggers DPIA requirements under GDPR Article 35.
Question 5: Accessibility compliance under the Americans with Disabilities Act (ADA) requires that ARIA roles be used correctly. Which Selenium assertion validates that a modal dialog has the correct ARIA role?
- assertEquals("dialog", driver.findElement(By.id("modal")).getAttribute("role")) (Correct answer)
- assertTrue(driver.findElement(By.id("modal")).isDisplayed())
- assertEquals("modal", driver.findElement(By.id("modal")).getTagName())
- assertNotNull(driver.findElement(By.cssSelector("[aria-hidden='false']")))
Correct answer: assertEquals("dialog", driver.findElement(By.id("modal")).getAttribute("role"))
Retrieving the role attribute and asserting it equals 'dialog' directly validates that the correct ARIA landmark is applied to the modal element.
Question 6: ISO/IEC 25010 defines software quality characteristics including security. Which Selenium test technique specifically addresses the security sub-characteristic of non-repudiation?
- Verifying that audit log entries are generated for each authenticated test action (Correct answer)
- Testing that session tokens expire after a configurable timeout
- Asserting that HTTPS is used for all form submissions
- Checking that password fields use the type='password' attribute
Correct answer: Verifying that audit log entries are generated for each authenticated test action
Non-repudiation requires that actions cannot be denied; verifying that audit logs record each authenticated action provides the evidence trail needed.
Question 7: When testing a cookie consent mechanism for ePrivacy Directive compliance, which Selenium sequence correctly simulates a user rejecting all non-essential cookies?
- Load the page, wait for the consent banner, click 'Reject All', then assert that only essential cookies are set (Correct answer)
- Load the page, delete all cookies via driver.manage().deleteAllCookies(), then proceed
- Load the page, assert that document.cookie is empty before any interaction
- Load the page in incognito mode to automatically reject all cookies
Correct answer: Load the page, wait for the consent banner, click 'Reject All', then assert that only essential cookies are set
The correct compliance test simulates the full user rejection flow and then verifies the browser state reflects only essential cookies, matching ePrivacy requirements.
A financial institution requires audit trails for all automated test executions.
Which Selenium framework feature best supports this requirement?