0
0
Selenium Javatesting~20 mins

EdgeOptions configuration in Selenium Java - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
EdgeOptions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this EdgeOptions configuration code?
Consider the following Java Selenium code snippet configuring EdgeOptions. What will be the value of the 'headless' argument in the EdgeOptions after execution?
Selenium Java
import org.openqa.selenium.edge.EdgeOptions;

public class TestEdgeOptions {
    public static void main(String[] args) {
        EdgeOptions options = new EdgeOptions();
        options.addArguments("--headless");
        options.addArguments("--disable-gpu");
        System.out.println(options.getArguments().contains("--headless"));
    }
}
ACompilation error
Bfalse
Ctrue
DRuntime exception
Attempts:
2 left
💡 Hint
Check how EdgeOptions stores and retrieves arguments.
assertion
intermediate
2:00remaining
Which assertion correctly verifies EdgeOptions has 'start-maximized' argument?
Given an EdgeOptions object named 'options' with 'start-maximized' argument added, which assertion correctly checks this in a JUnit test?
Selenium Java
EdgeOptions options = new EdgeOptions();
options.addArguments("start-maximized");
AassertTrue(options.getArguments().contains("start-maximized"));
BassertFalse(options.getArguments().contains("start-maximized"));
CassertEquals(options.getArguments(), "start-maximized");
DassertNull(options.getArguments());
Attempts:
2 left
💡 Hint
Check the type returned by getArguments() and how to verify list contents.
🔧 Debug
advanced
2:00remaining
Why does this EdgeOptions code throw an IllegalArgumentException?
Examine the code below. Why does it throw an IllegalArgumentException at runtime?
Selenium Java
EdgeOptions options = new EdgeOptions();
options.addArguments(null);
ABecause EdgeOptions must be initialized with a WebDriver instance first.
BBecause addArguments() expects a list, not a single string.
CBecause the code is missing a required import statement.
DBecause addArguments() does not accept null and throws IllegalArgumentException.
Attempts:
2 left
💡 Hint
Check the method contract for addArguments() regarding null values.
🧠 Conceptual
advanced
2:00remaining
What is the effect of setting EdgeOptions.setPageLoadStrategy(PageLoadStrategy.NONE)?
In Selenium EdgeOptions, what does setting the page load strategy to NONE do during page navigation?
AThe driver does not wait for any page loading; commands proceed immediately after navigation starts.
BThe driver waits until the entire page including images and scripts is fully loaded.
CThe driver waits only for the DOMContentLoaded event before proceeding.
DThe driver throws an error if the page takes longer than default timeout to load.
Attempts:
2 left
💡 Hint
Think about how page load strategies affect waiting behavior.
framework
expert
3:00remaining
Which EdgeOptions configuration enables running tests with a custom user profile directory?
You want to run Edge browser tests using a specific user profile directory located at 'C:\Users\TestUser\EdgeProfile'. Which EdgeOptions code snippet correctly sets this?
Aoptions.setProfile("C:\\Users\\TestUser\\EdgeProfile");
Boptions.addArguments("--user-data-dir=C:\\Users\\TestUser\\EdgeProfile");
Coptions.setCapability("user-data-dir", "C:\\Users\\TestUser\\EdgeProfile");
Doptions.addArguments("user-data-dir=C:\\Users\\TestUser\\EdgeProfile");
Attempts:
2 left
💡 Hint
Check the correct argument format for user data directory in EdgeOptions.