Selenium WebDriver Cheat Sheet 2026

The 30 highest-yield Selenium WebDriver facts, distilled from real exam questions. Print it, save it as a PDF, or study it here β€” free, no sign-up.

  1. Which driver implementation is used for Microsoft Edge in Selenium 4? β†’ EdgeDriver
  2. When prioritizing which Selenium tests to automate first using risk-based testing, which criterion should drive selection? β†’ Tests covering high-frequency user workflows with high defect impact if broken
  3. A test automates a flight-booking site that uses dynamic IDs like 'btn_12849_submit'. Which locator strategy is most resilient to ID changes? β†’ CSS selector targeting a stable attribute like [data-testid='submit-booking']
  4. In Selenium, what is the correct method to retrieve the text content of a web element? β†’ element.getText()
  5. Which approach best mitigates the risk of Selenium tests breaking after a CSS redesign that changes element classes? β†’ Locate elements by stable attributes like data-testid added for automation
  6. Which class is used to configure Chrome-specific options in Selenium WebDriver? β†’ ChromeOptions
  7. A QA engineer notices that a Selenium test suite runs for 45 minutes on CI. What is the most professional first step to address this? β†’ Profile which tests are slowest and identify parallelization opportunities
  8. Which XPath function is used to find elements whose attribute value contains a specific substring? β†’ contains()
  9. A risk assessment identifies that Selenium tests regularly time out when clicking elements obscured by cookie banners. What is the root cause risk? β†’ Unexpected UI overlays blocking element interaction
  10. How should an Selenium WebDriver professional handle a situation outside their scope of competency? β†’ Recognize limitations and refer to or consult with appropriate specialists
  11. When `driver.findElement(By.tagName("input"))` is called and multiple `` elements exist on the page, what happens? β†’ It returns the first matching input element in DOM order
  12. Which Selenium component is used to run tests in parallel across multiple browsers? β†’ Selenium Grid
  13. Which practice mitigates the risk of Selenium tests producing false positives β€” tests that pass even when the application is broken? β†’ Asserting on specific element content and state, not just element presence
  14. Evidence-based performance testing practice distinguishes Selenium from tools like k6 or JMeter by recognizing that Selenium is best suited for: β†’ Measuring real browser rendering performance from a user's perspective
  15. Which WebDriver method returns the current page source HTML as a string? β†’ driver.getPageSource()
  16. Which risk is most associated with automating Selenium tests against a staging environment that differs significantly from production? β†’ Defects present only in production are not caught before release
  17. A test verifies an email is sent after form submission. The email service is slow (up to 30 seconds). What is the correct testing strategy? β†’ Poll the inbox using WebDriverWait with a 30-second timeout and a custom ExpectedCondition
  18. What is the quality assurance purpose of end-to-end (E2E) Selenium tests compared to unit tests? β†’ E2E tests validate complete user workflows across all integrated layers of the application
  19. In QA reporting for Selenium suites, what does a high test execution time trend typically indicate? β†’ Growing test suite size, environment slowdowns, or inefficient waits needing optimization
  20. Research into cross-browser testing recommends which prioritization strategy when browser coverage must be limited by budget? β†’ Prioritize browsers by actual user traffic share from analytics data
  21. What does the CSS selector 'input[type="submit"]' target in Selenium? β†’ All input elements with type attribute equal to submit
  22. Your team tests a file-upload feature that opens a native OS dialog. How should Selenium handle this scenario? β†’ Send the file path directly to the hidden input element using sendKeys()
  23. What does the 'script' timeout control in WebDriver? β†’ How long to wait for asynchronous JavaScript to execute
  24. What is a FluentWait in Selenium WebDriver? β†’ A configurable wait that can ignore specific exceptions and set polling frequency
  25. Studies on Selenium test maintenance show that tests written without explicit assertions on expected state most commonly lead to: β†’ False positives β€” tests pass even when the application is broken
  26. What does driver.manage().getCookies() return? β†’ A Set of all cookies for the current domain
  27. What QA strategy validates that a new Selenium test suite correctly catches known defects by intentionally introducing bugs? β†’ Mutation testing
  28. Which locator strategy is generally considered the most reliable for identifying web elements in Selenium WebDriver? β†’ ID
  29. A Selenium automation engineer is asked to estimate effort for automating a new module. Which factor is most important to assess first? β†’ The stability and testability of the UI (dynamic IDs, iframes, frequent redesigns)
  30. How do you close only the current browser window (not the entire session) in WebDriver? β†’ driver.close()
Was this helpful?