Test Overview
This test opens the Microsoft Edge browser with customized options using EdgeOptions. It verifies that the browser starts with the specified options and navigates to the correct URL.
This test opens the Microsoft Edge browser with customized options using EdgeOptions. It verifies that the browser starts with the specified options and navigates to the correct URL.
import org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeOptions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class EdgeOptionsTest { private WebDriver driver; @BeforeEach public void setUp() { EdgeOptions options = new EdgeOptions(); options.addArguments("--start-maximized"); options.addArguments("--disable-notifications"); driver = new EdgeDriver(options); } @Test public void testNavigateToExample() { driver.get("https://example.com"); String currentUrl = driver.getCurrentUrl(); assertEquals("https://example.com", currentUrl); } @AfterEach public void tearDown() { if (driver != null) { driver.quit(); } } }
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Create EdgeOptions instance and add arguments '--start-maximized' and '--disable-notifications' | EdgeOptions object configured with specified arguments | - | PASS |
| 2 | Initialize EdgeDriver with the configured EdgeOptions | Microsoft Edge browser opens with maximized window and notifications disabled | - | PASS |
| 3 | Navigate to 'https://example.com' | Browser loads the example.com homepage | - | PASS |
| 4 | Get current URL from browser | Current URL is 'https://example.com' | Verify current URL equals 'https://example.com' | PASS |
| 5 | Close the browser using driver.quit() | Browser window closes and WebDriver session ends | - | PASS |