I have been trying to login to faceboook and search a friend using Selenium. But I am stuck on this particular popup, and can't resolve this issue to proceed further.
public class FbAutomation {
public static void main(String[] args) {
FirefoxDriver browser = new FirefoxDriver();
browser.get("https://www.facebook.com/");
browser.manage().window().maximize();
browser.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
browser.findElement(By.xpath("//input[@name='email']")).sendKeys("user-email");
browser.findElement(By.xpath("//input[@name='pass']")).sendKeys("password");
/*Dimension radi = browser.findElement(By.xpath("//label[@id='loginbutton']")).getSize();
System.out.println("height is " + radi.height + " and width is " + radi.width);*/
browser.findElement(By.xpath("//label[@id='loginbutton']")).submit();
browser.navigate().to("https://www.facebook.com/imshaiknasir");
Alert alt = browser.switchTo().alert();
alt.accept();
/*
* Not able to handle "Allow notification" popUp box.
*/`enter code here`
browser.close();
}
}