Challenge - 5 Problems
Firefox 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 Firefox profile configuration code?
Consider the following Selenium Python code that sets a Firefox profile preference. What will be the value of the preference
browser.startup.homepage after running this code?Selenium Python
from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options from selenium.webdriver.firefox.firefox_profile import FirefoxProfile profile = FirefoxProfile() profile.set_preference('browser.startup.homepage', 'https://example.com') profile.update_preferences() options = Options() options.profile = profile print(profile.default_preferences.get('browser.startup.homepage'))
Attempts:
2 left
💡 Hint
Check how preferences are set and accessed in FirefoxProfile.
✗ Incorrect
The code sets the preference 'browser.startup.homepage' to 'https://example.com' using set_preference. Accessing it via default_preferences.get returns the set value.
❓ assertion
intermediate1:30remaining
Which assertion correctly verifies Firefox runs in headless mode?
Given a Selenium Firefox WebDriver instance configured to run headless, which assertion correctly checks that the browser is running in headless mode?
Selenium Python
from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options options = Options() options.headless = True driver = Firefox(options=options) # Which assertion below is correct?
Attempts:
2 left
💡 Hint
Check the capabilities dictionary for the 'moz:headless' key.
✗ Incorrect
The 'moz:headless' capability is set to True when Firefox runs headless. The other options check wrong keys or values.
🔧 Debug
advanced2:30remaining
Why does this Firefox WebDriver fail to start with a custom profile?
This Selenium Python code tries to start Firefox with a custom profile but raises an error. Identify the cause.
Selenium Python
from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options from selenium.webdriver.firefox.firefox_profile import FirefoxProfile profile = FirefoxProfile('/path/to/custom/profile') options = Options() options.profile = profile driver = Firefox(options=options)
Attempts:
2 left
💡 Hint
Check if the profile path exists and is accessible.
✗ Incorrect
If the profile path does not exist or is inaccessible, FirefoxProfile initialization fails causing the WebDriver to fail starting.
❓ framework
advanced2:00remaining
How to configure Firefox to accept insecure certificates in Selenium Python?
You want Firefox WebDriver to accept insecure SSL certificates during tests. Which code snippet correctly configures this?
Attempts:
2 left
💡 Hint
Check the Options class for accepting insecure certs.
✗ Incorrect
Setting options.accept_insecure_certs = True is the correct way to allow insecure certificates in Firefox WebDriver.
🧠 Conceptual
expert1:30remaining
What is the effect of setting 'dom.webnotifications.enabled' to False in Firefox profile?
In Firefox profile preferences, what does setting
dom.webnotifications.enabled to False do during automated testing?Attempts:
2 left
💡 Hint
Think about how notifications affect test stability.
✗ Incorrect
Setting 'dom.webnotifications.enabled' to False disables web push notifications, which can interfere with automated tests by causing unexpected pop-ups.