Challenge - 5 Problems
Chrome Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Selenium Chrome configuration code?
Consider the following Python Selenium code snippet that configures Chrome options and launches a browser. What will be printed after execution?
Selenium Python
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless') options.add_argument('--disable-gpu') driver = webdriver.Chrome(options=options) print(driver.capabilities.get('headless')) driver.quit()
Attempts:
2 left
💡 Hint
Check how the 'headless' argument affects the capabilities dictionary.
✗ Incorrect
When Chrome is launched with the '--headless' argument, the 'headless' capability is not explicitly set in the driver capabilities dictionary. Therefore, accessing driver.capabilities.get('headless') returns None.
❓ locator
intermediate1:30remaining
Which Chrome option disables the browser's password manager prompt?
You want to configure Chrome to prevent the password manager popup during automated tests. Which option should you add to ChromeOptions?
Attempts:
2 left
💡 Hint
Look for the option that specifically mentions disabling the save password bubble.
✗ Incorrect
The correct Chrome option to disable the password manager prompt is '--disable-save-password-bubble'. Other options are invalid or do not exist.
❓ assertion
advanced2:00remaining
Which assertion correctly verifies Chrome is running in incognito mode?
Given a Selenium WebDriver instance 'driver' configured with ChromeOptions to run in incognito mode, which assertion correctly checks this?
Selenium Python
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--incognito') driver = webdriver.Chrome(options=options)
Attempts:
2 left
💡 Hint
Check where ChromeOptions arguments are stored in capabilities.
✗ Incorrect
The ChromeOptions arguments are stored under 'goog:chromeOptions' key in capabilities as a list under 'args'. The '--incognito' argument presence confirms incognito mode.
🔧 Debug
advanced2:30remaining
Why does this Chrome configuration code raise a SessionNotCreatedException?
Analyze the following code snippet. Why does it raise a SessionNotCreatedException when executed?
Selenium Python
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless') options.add_argument('--disable-gpu') options.add_argument('--window-size=1920,1080') options.add_argument('--disable-dev-shm-usage') options.add_argument('--no-sandbox') options.add_argument('--remote-debugging-port=9222') # Incorrect chromedriver path driver = webdriver.Chrome(executable_path='/wrong/path/chromedriver', options=options) driver.get('https://example.com')
Attempts:
2 left
💡 Hint
Check the executable_path parameter and its correctness.
✗ Incorrect
SessionNotCreatedException often occurs when the chromedriver executable path is invalid or the driver binary is missing. Here, the path '/wrong/path/chromedriver' is incorrect, so the driver cannot start a session.
❓ framework
expert3:00remaining
Which ChromeOptions configuration ensures maximum test stability in CI environments?
Select the ChromeOptions configuration that best improves test stability and performance in Continuous Integration (CI) environments.
Attempts:
2 left
💡 Hint
Consider options that reduce resource usage and sandbox issues in CI.
✗ Incorrect
In CI environments, running Chrome headless with '--no-sandbox' and '--disable-dev-shm-usage' improves stability by avoiding sandbox and shared memory issues. '--disable-gpu' is recommended for headless mode.