My apologies in advance if my question sounds primary, I am very new at QA and Selenium.
I am using Java and Selenium to write a test, at one of my test's step when I click on a button it is supposed to open another window but Chrome blocks the popup window, can I enable popup by Selenium?
If anyone is still encountering this problem, it's probably because they are on an old version of ChromeDriver. Popup blocking was disabled by default from version 21+
Reference: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1291
There is also another option to enable popup windows. Because sometimes your company may block you from accessing any application in admin mode. If the above method fails to work, you can use the below codes to enable pop ups.
Well, you need to initialize the
ChromeDriver
with a customized configuration which will disable the flag to block popups. From this site, the command line switch for it isdisable-popup-blocking
. So, usingChromeOptions
andDesiredCapabilities
, you add the desired config using theDesiredCapabilities.setCapability()
function.EDIT: Just found the same solution on this site.