0
0
Selenium Javatesting~10 mins

FirefoxOptions 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 FirefoxOptions object.

Selenium Java
FirefoxOptions options = new [1]();
Drag options to blanks, or click blank then click option'
AFirefoxOptions
BChromeOptions
CWebDriver
DFirefoxDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using ChromeOptions instead of FirefoxOptions.
Using FirefoxDriver instead of FirefoxOptions.
2fill in blank
medium

Complete the code to set Firefox to run in headless mode.

Selenium Java
options.[1](true);
Drag options to blanks, or click blank then click option'
AsetHeadless
BsetHeadlessMode
CenableHeadless
Dheadless
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method name that does not exist like setHeadlessMode.
Trying to set a property directly instead of using the method.
3fill in blank
hard

Fix the error in the code to add an argument to FirefoxOptions.

Selenium Java
options.addArguments([1]);
Drag options to blanks, or click blank then click option'
A'--disable-gpu'
B"--disable-gpu"
C--disable-gpu
Ddisable-gpu
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the argument without quotes.
Using single quotes instead of double quotes.
4fill in blank
hard

Fill both blanks to create FirefoxOptions and set it to accept insecure certificates.

Selenium Java
FirefoxOptions options = new [1]();
options.[2](true);
Drag options to blanks, or click blank then click option'
AFirefoxOptions
BsetAcceptInsecureCerts
CsetHeadless
DFirefoxDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using FirefoxDriver instead of FirefoxOptions.
Using setHeadless instead of setAcceptInsecureCerts.
5fill in blank
hard

Fill all three blanks to create FirefoxOptions, set headless mode, and add a custom argument.

Selenium Java
FirefoxOptions options = new [1]();
options.[2](true);
options.addArguments([3]);
Drag options to blanks, or click blank then click option'
AFirefoxOptions
BsetHeadless
C"--window-size=1920,1080"
DsetAcceptInsecureCerts
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names or missing quotes around the argument.
Confusing setAcceptInsecureCerts with setHeadless.