Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Explain how you will login into any site if it is showing any authentication popup for username and password?

Category: Selenium WebDriver
WebDriverWait wait = new WebDriverWait(driver, 10); 
Alert alert = wait.until(ExpectedConditions.alertIsPresent()); 
alert.authenticateUsing(new UserAndPassword(**username**, **password**));

Since there will be popup for logging in, we need to use the explicit command and verify if the alert is actually present. Only if the alert is present, we need to pass the username and password credentials.

Leave a Reply

Your email address will not be published. Required fields are marked *