Created
May 14, 2024 10:40
-
-
Save harsha509/6a8c7ada90a83040e4f85e8bafa9938b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void canContinueWithAuthCredentials() { | |
try (Network network = new Network(driver)) { | |
network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED)); | |
network.onAuthRequired( | |
responseDetails -> | |
network.continueWithAuth( | |
responseDetails.getRequest().getRequestId(), | |
new UsernameAndPassword("admin", "admin"))); | |
driver.get("https://the-internet.herokuapp.com/basic_auth"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment