0
0
Selenium Javatesting~10 mins

WebDriver setup (ChromeDriver) in Selenium Java - 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 new ChromeDriver instance.

Selenium Java
WebDriver driver = new [1]();
Drag options to blanks, or click blank then click option'
ASafariDriver
BEdgeDriver
CFirefoxDriver
DChromeDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using FirefoxDriver instead of ChromeDriver.
Forgetting to import the ChromeDriver class.
2fill in blank
medium

Complete the code to set the system property for ChromeDriver executable path.

Selenium Java
System.setProperty("webdriver.chrome.driver", [1]);
Drag options to blanks, or click blank then click option'
A"path/to/edgedriver.exe"
B"path/to/geckodriver.exe"
C"path/to/chromedriver.exe"
D"path/to/safaridriver.exe"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the path to the wrong driver executable.
Not using quotes around the path string.
3fill in blank
hard

Fix the error in the code to properly import the ChromeDriver class.

Selenium Java
import org.openqa.selenium.[1];
Drag options to blanks, or click blank then click option'
Achrome.ChromeDriver
Bfirefox.FirefoxDriver
Cedge.EdgeDriver
Dsafari.SafariDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Importing FirefoxDriver instead of ChromeDriver.
Missing the import statement entirely.
4fill in blank
hard

Fill both blanks to initialize ChromeDriver and open the URL "https://example.com".

Selenium Java
WebDriver driver = new [1]();
driver.[2]("https://example.com");
Drag options to blanks, or click blank then click option'
AChromeDriver
Bget
Cnavigate
DFirefoxDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using FirefoxDriver instead of ChromeDriver.
Using navigate without to method.
5fill in blank
hard

Fill all three blanks to properly quit the ChromeDriver session after opening a page.

Selenium Java
WebDriver driver = new [1]();
driver.[2]("https://example.com");
driver.[3]();
Drag options to blanks, or click blank then click option'
AChromeDriver
Bget
Cquit
Dclose
Attempts:
3 left
💡 Hint
Common Mistakes
Using close instead of quit which only closes one window.
Not quitting the driver at all.