0
0
Selenium Javatesting~10 mins

EdgeOptions configuration 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 EdgeOptions object.

Selenium Java
EdgeOptions options = new [1]();
Drag options to blanks, or click blank then click option'
ASafariOptions
BChromeOptions
CFirefoxOptions
DEdgeOptions
Attempts:
3 left
💡 Hint
Common Mistakes
Using ChromeOptions or FirefoxOptions instead of EdgeOptions.
Forgetting to instantiate the object with new keyword.
2fill in blank
medium

Complete the code to add the argument to start Edge in headless mode.

Selenium Java
options.addArguments([1]);
Drag options to blanks, or click blank then click option'
A"--disable-gpu"
B"--headless"
C"--start-maximized"
D"--incognito"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "--disable-gpu" which disables GPU but does not make browser headless.
Using "--start-maximized" which opens browser maximized but visible.
3fill in blank
hard

Fix the error in setting the binary path for Edge browser.

Selenium Java
options.setBinary([1]);
Drag options to blanks, or click blank then click option'
Anew File("C:/Program Files/Microsoft/Edge/Application/msedge.exe")
BPaths.get("C:/Program Files/Microsoft/Edge/Application/msedge.exe")
C"C:/Program Files/Microsoft/Edge/Application/msedge.exe"
DPath.of("C:/Program Files/Microsoft/Edge/Application/msedge.exe")
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a File object instead of a String.
Passing a Path object which causes a type mismatch.
4fill in blank
hard

Fill both blanks to set EdgeOptions to accept insecure certificates and disable extensions.

Selenium Java
options.setAcceptInsecureCerts([1]);
options.addArguments([2]);
Drag options to blanks, or click blank then click option'
Atrue
B"--disable-extensions"
Cfalse
D"--enable-automation"
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for accepting insecure certificates disables this feature.
Using wrong argument strings that do not disable extensions.
5fill in blank
hard

Fill all three blanks to create EdgeOptions with headless mode, set window size, and disable GPU.

Selenium Java
options.addArguments([1]);
options.addArguments([2]);
options.addArguments([3]);
Drag options to blanks, or click blank then click option'
A"--headless"
B"--window-size=1920,1080"
C"--disable-gpu"
D"--incognito"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to disable GPU which can cause issues in headless mode.
Using incorrect window size format.