Hey Ritika, you can handle multiple windows in Selenium Webdriver by using driver.getWindowHandles() method. Check this code snippet for understanding better:
String currentWindow = driver.getWindowHandle(); //get parent(current) window name
for(String popup :driver.getWindowHandles()) //iterating on child windows
{
driver.switchTo().window(popup);
System.out.println("Popup values: "+popup);
// Perform any operations on child window
}
driver.switchTo().window(currentWindow); //switch back to main window & continue further execution