0
0
Selenium Pythontesting~10 mins

WebDriver setup (ChromeDriver, GeckoDriver) 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 import the Selenium WebDriver module.

Selenium Python
from selenium import [1]
Drag options to blanks, or click blank then click option'
Abrowser
Bdriver
Cselenium
Dwebdriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'driver' instead of 'webdriver' causes import errors.
Importing 'selenium' alone does not provide browser control.
2fill in blank
medium

Complete the code to create a Chrome WebDriver instance.

Selenium Python
driver = webdriver.[1]()
Drag options to blanks, or click blank then click option'
AChrome
BEdge
CFirefox
DSafari
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'chrome' causes attribute errors.
Choosing a different browser name launches the wrong browser.
3fill in blank
hard

Fix the error in the code to set up GeckoDriver for Firefox.

Selenium Python
driver = webdriver.[1]()
Drag options to blanks, or click blank then click option'
AChrome
BFirefox
CGecko
Dfirefox
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'firefox' causes attribute errors.
Trying to use 'Gecko' is invalid in Selenium WebDriver.
4fill in blank
hard

Fill in the blank to specify the path to ChromeDriver executable correctly.

Selenium Python
driver = webdriver.Chrome(executable_path=[1])
Drag options to blanks, or click blank then click option'
A"/usr/local/bin/chromedriver"
B"chromedriver.exe"
C"/"
D"\\"
Attempts:
3 left
💡 Hint
Common Mistakes
Using backslash \\ on Unix causes path errors.
Omitting quotes around the path causes syntax errors.
5fill in blank
hard

Fill all three blanks to import WebDriver, create Firefox driver, and open a URL.

Selenium Python
from selenium import [1]
driver = [2].Firefox()
driver.[3]("https://example.com")
Drag options to blanks, or click blank then click option'
Awebdriver
Cget
Dfirefox
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'firefox' instead of 'webdriver' for driver creation.
Using 'open' instead of 'get' to open a URL.