0
0
Selenium Pythontesting~20 mins

Chrome configuration in Selenium Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Chrome Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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()
ANone
BFalse
CTrue
DKeyError
Attempts:
2 left
💡 Hint
Check how the 'headless' argument affects the capabilities dictionary.
locator
intermediate
1: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?
A--disable-password-manager
B--disable-save-password-bubble
C--disable-password-save
D--disable-password-manager-reauthentication
Attempts:
2 left
💡 Hint
Look for the option that specifically mentions disabling the save password bubble.
assertion
advanced
2: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)
Aassert '--incognito' in driver.capabilities['goog:chromeOptions']['args']
Bassert driver.capabilities['chromeOptions']['incognito'] is True
Cassert driver.execute_script('return window.navigator.incognito') == True
Dassert driver.capabilities['incognito'] == True
Attempts:
2 left
💡 Hint
Check where ChromeOptions arguments are stored in capabilities.
🔧 Debug
advanced
2: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')
AThe '--no-sandbox' argument requires root privileges and causes failure.
BThe '--remote-debugging-port' argument conflicts with headless mode.
CThe chromedriver executable path is incorrect, causing failure to start the session.
DThe '--disable-gpu' argument is deprecated and causes errors.
Attempts:
2 left
💡 Hint
Check the executable_path parameter and its correctness.
framework
expert
3: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.
A
options.add_argument('--incognito')
options.add_argument('--disable-popup-blocking')
options.add_argument('--disable-plugins')
B
options.add_argument('--start-maximized')
options.add_argument('--disable-extensions')
options.add_argument('--disable-infobars')
C
options.add_argument('--remote-debugging-port=9222')
options.add_argument('--enable-automation')
options.add_argument('--disable-browser-side-navigation')
D
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
Attempts:
2 left
💡 Hint
Consider options that reduce resource usage and sandbox issues in CI.