Challenge - 5 Problems
EdgeOptions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2: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")); } }
Attempts:
2 left
💡 Hint
Check how EdgeOptions stores and retrieves arguments.
✗ Incorrect
The code adds '--headless' as an argument to EdgeOptions. The getArguments() method returns a list containing this argument, so contains('--headless') returns true.
❓ assertion
intermediate2: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");Attempts:
2 left
💡 Hint
Check the type returned by getArguments() and how to verify list contents.
✗ Incorrect
getArguments() returns a list of strings. To check if 'start-maximized' is present, use contains() inside assertTrue.
🔧 Debug
advanced2: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);
Attempts:
2 left
💡 Hint
Check the method contract for addArguments() regarding null values.
✗ Incorrect
The addArguments() method does not accept null arguments and throws IllegalArgumentException if null is passed.
🧠 Conceptual
advanced2: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?
Attempts:
2 left
💡 Hint
Think about how page load strategies affect waiting behavior.
✗ Incorrect
PageLoadStrategy.NONE means Selenium does not wait for any page load event and proceeds immediately after navigation starts.
❓ framework
expert3: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?
Attempts:
2 left
💡 Hint
Check the correct argument format for user data directory in EdgeOptions.
✗ Incorrect
The correct argument to specify user profile directory is '--user-data-dir=path'. It must include the double dash prefix.