0
0
Selenium Pythontesting~10 mins

Browser profile configuration in Selenium Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Firefox profile object.

Selenium Python
from selenium.webdriver import FirefoxProfile
profile = [1]()
Drag options to blanks, or click blank then click option'
AFirefoxProfile
BFirefoxOptions
CWebDriver
DService
Attempts:
3 left
💡 Hint
Common Mistakes
Using FirefoxOptions() instead of FirefoxProfile()
Trying to create a profile with WebDriver class
Using Service class which is for driver service setup
2fill in blank
medium

Complete the code to set a preference in the Firefox profile.

Selenium Python
profile = FirefoxProfile()
profile.[1]('browser.startup.homepage', 'https://example.com')
Drag options to blanks, or click blank then click option'
Aset_option
Badd_argument
Cadd_preference
Dset_preference
Attempts:
3 left
💡 Hint
Common Mistakes
Using add_argument which is for command line options
Using set_option which is not a Firefox profile method
Using add_preference which does not exist
3fill in blank
hard

Fix the error in the code to load the Firefox profile into options.

Selenium Python
from selenium.webdriver import Firefox, FirefoxOptions, FirefoxProfile
profile = FirefoxProfile()
options = FirefoxOptions()
options.[1] = profile.path
browser = Firefox(options=options)
Drag options to blanks, or click blank then click option'
Aprofile
Badd_profile
Cprofile_path
Dset_profile
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting .path: options.profile = profile
Using profile_path which is not an attribute
Using add_profile which does not exist
4fill in blank
hard

Fill both blanks to create a Firefox driver with a custom profile and disable notifications.

Selenium Python
profile = FirefoxProfile()
profile.[1]('dom.webnotifications.enabled', False)
options = FirefoxOptions()
options.[2] = profile.path
driver = Firefox(options=options)
Drag options to blanks, or click blank then click option'
Aset_preference
Bprofile
Cadd_argument
Dadd_extension
Attempts:
3 left
💡 Hint
Common Mistakes
Using add_argument instead of set_preference
Forgetting .path or wrong assignment for profile
Using add_extension which is unrelated here
5fill in blank
hard

Fill all three blanks to create a Firefox profile, set homepage, assign profile to options, and start the browser.

Selenium Python
profile = FirefoxProfile()
profile.[1]('browser.startup.homepage', 'https://openai.com')
options = FirefoxOptions()
options.[2] = profile.path
driver = Firefox([3]=options)
Drag options to blanks, or click blank then click option'
Aset_preference
Bset_profile
Coptions
Dprofile
Attempts:
3 left
💡 Hint
Common Mistakes
Passing profile instead of options to Firefox constructor
Using wrong argument name like profile instead of options
Not setting preference correctly