Reputation: 123
I can’t click on “allow” in the permission pop up. I tried this, but it didn't work.
WebDriver driver= DriverFactory.getDriver();
Alert al= driver.switchTo().alert();
al.accept();
Does it exist any other option to handle the click of Chrome Browser pop ups. Thanks in advance.
Upvotes: 1
Views: 731
Reputation: 253
It happened to me too First create a java.awt.Robot instance,
Then call keyPress() method on robot
(VK_TAB) is used to go to ‘Allow’ button, then (VK_ENTER) clicks it.
Upvotes: 1