Monday 1 August 2022

Selenium Authentication Popup | How To Handle Login popup Window using Selenium Webdriver

                   In this post, we will see Selenium Authentication Popup | How To Handle Login popup Window using Selenium Webdriver


Program Code (AuthenticationPopupForLogin.java) :

package main;


import java.time.Duration;


import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;


public class AuthenticationPopupForLogin {


public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver_win32\\chromedriver.exe");

WebDriver driver=new ChromeDriver();

String username="abc";

String password="123";

String url="https://"+username+":"+password+"@the-internet.herokuapp.com/basic_auth";

driver.get(url);

//https://abc:123@the-internet.herokuapp.com/basic_auth

driver.manage().window().maximize();

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));


}


}


Watch following video:


Watch on YouTube: https://www.youtube.com/watch?v=7bSwsoeWilc


No comments:

Post a Comment