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.
- Which driver implementation is used for Microsoft Edge in Selenium 4? β EdgeDriver
- 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
- 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']
- In Selenium, what is the correct method to retrieve the text content of a web element? β element.getText()
- 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
- Which class is used to configure Chrome-specific options in Selenium WebDriver? β ChromeOptions
- 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
- Which XPath function is used to find elements whose attribute value contains a specific substring? β contains()
- 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
- How should an Selenium WebDriver professional handle a situation outside their scope of competency? β Recognize limitations and refer to or consult with appropriate specialists
- 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
- Which Selenium component is used to run tests in parallel across multiple browsers? β Selenium Grid
- 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
- 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
- Which WebDriver method returns the current page source HTML as a string? β driver.getPageSource()
- 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
- 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
- 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
- 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
- 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
- What does the CSS selector 'input[type="submit"]' target in Selenium? β All input elements with type attribute equal to submit
- 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()
- What does the 'script' timeout control in WebDriver? β How long to wait for asynchronous JavaScript to execute
- What is a FluentWait in Selenium WebDriver? β A configurable wait that can ignore specific exceptions and set polling frequency
- 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
- What does driver.manage().getCookies() return? β A Set of all cookies for the current domain
- What QA strategy validates that a new Selenium test suite correctly catches known defects by intentionally introducing bugs? β Mutation testing
- Which locator strategy is generally considered the most reliable for identifying web elements in Selenium WebDriver? β ID
- 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)
- How do you close only the current browser window (not the entire session) in WebDriver? β driver.close()
Turn these facts into recall:
Was this helpful?