Continuous Integration (CI) tools run tests automatically after code changes. Why does this help testers get faster feedback?
Think about when tests run in CI compared to manual testing.
CI runs tests automatically on every code change, so bugs are found quickly. This speeds up feedback to developers and testers.
Given this Selenium Python test code, what will be the test outcome when run in a CI pipeline?
from selenium import webdriver from selenium.webdriver.common.by import By options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options) driver.get('https://example.com') header = driver.find_element(By.TAG_NAME, 'h1').text driver.quit() assert header == 'Example Domain'
Check if the code uses headless mode and if the element exists on the page.
The test runs headless Chrome in CI, finds the 'h1' tag with text 'Example Domain', so the assertion passes.
In CI pipelines, tests must be stable and not break often. Which locator strategy below is best for finding a login button?
Think about which locator is least likely to change and most specific.
ID locators are unique and stable, making tests less flaky in CI. Other locators may break if text or classes change.
In a Selenium test running in CI, which assertion correctly checks that the page title is exactly 'Dashboard'?
title = driver.title
Check which assertion exactly matches the title.
Option A asserts the title equals 'Dashboard' exactly, which is the correct check.
Which statement best explains how integrating test automation frameworks with CI tools improves continuous testing?
Think about how CI triggers tests and the impact on feedback speed.
CI integration runs tests automatically on every commit, catching bugs early and supporting continuous testing.