Challenge - 5 Problems
Selenium CI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of Selenium WebDriver in headless mode
What will be the output when running this Selenium Python script in a CI pipeline with headless Chrome?
Selenium Python
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless') driver = webdriver.Chrome(options=options) driver.get('https://example.com') title = driver.title driver.quit() print(title)
Attempts:
2 left
💡 Hint
Headless mode allows Chrome to run without opening a window, so the page title can still be retrieved.
✗ Incorrect
The script runs Chrome in headless mode, navigates to example.com, and prints the page title 'Example Domain'.
❓ Troubleshoot
intermediate2:00remaining
Fixing ChromeDriver version mismatch error in CI
In a CI pipeline, Selenium tests fail with the error: 'This version of ChromeDriver only supports Chrome version 90'. What is the best way to fix this?
Attempts:
2 left
💡 Hint
ChromeDriver and Chrome browser versions must be compatible.
✗ Incorrect
The error occurs because ChromeDriver version does not match the installed Chrome browser version. Updating ChromeDriver to the correct version resolves this.
❓ Configuration
advanced2:00remaining
Configuring Selenium to run with Firefox in CI
Which configuration snippet correctly sets up Selenium WebDriver to run Firefox in headless mode in a CI pipeline?
Attempts:
2 left
💡 Hint
Use the correct import and method to add headless argument for Firefox.
✗ Incorrect
Option D correctly imports Options, adds '--headless' argument, and passes options to Firefox WebDriver.
🔀 Workflow
advanced2:00remaining
Best CI workflow step to run Selenium tests
In a CI pipeline, which step order ensures Selenium tests run reliably with Chrome in headless mode?
Attempts:
2 left
💡 Hint
Chrome and ChromeDriver must be installed before running tests.
✗ Incorrect
Tests require Chrome and ChromeDriver installed first. Running tests before installation causes failure.
🧠 Conceptual
expert2:00remaining
Why use virtual display (Xvfb) in Selenium CI pipelines?
What is the main reason to use a virtual display like Xvfb when running Selenium tests in CI pipelines on Linux servers?
Attempts:
2 left
💡 Hint
Linux servers often lack a graphical desktop environment.
✗ Incorrect
Xvfb creates a virtual framebuffer so browsers can run graphical tests without needing a real display.