| Summary: | Safari preferences for setting Pop-up Windows not working in Selenium tests with Webdriver | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | harshit | ||||
| Component: | WebDriver | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | NEW --- | ||||||
| Severity: | Major | CC: | bburg, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Other | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Other | ||||||
| Attachments: |
|
||||||
Attaching sample script to reproduce the issue herein. To change safari preferences
1. Open safari Browser
2. Go to preferences
3. Go to Pop-up Windows
4. Select one of the three modes given next to "When visiting other websites"
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
driver = webdriver.Safari()
driver.get("https://deliver.courseavenue.com/PopupTest.aspx")
element = driver.find_element_by_css_selector('#ctl00_ContentMain_popupTest')
action = ActionChains(driver)
action.click(element).perform()
time.sleep(10)
driver.quit()
|
Created attachment 427039 [details] GIF showing the bug inside locally executed selenium through webdriver in which pop-up functionality is tested. Browsers: Safari 12.1, 13.1 and 14 Safari provides pop-up windows preferences to be set to three modes. "Block", "Block and Notify" and "Allow". These preferences work when running in a normal Safari session. However, on running selenium tests with webdriver the settings are not honoured and the default behavior is set to always allow popups even when set to "Block" or "Block and Notify". Note: when the running selenium session is stopped manually by interfering through mouse click, even after stopped session the same behavior is observed wherein pop-up preference is not being honored even on manually testing popup feature.