Unwanted browser notification prompts during Selenium test runs
0 reputation · 23 May 2023, 02:17 UTC
Symptom
The goal is to minimize disruptive browser notification permission prompts that appear during automated Selenium sessions, while still allowing tests that deliberately verify notification handling to observe the prompt when needed.
Constraints arise because notification prompts are not JavaScript alerts; they are governed by browser profile preferences that differ between Chrome and Firefox, and the supported preference keys can change across driver releases, making a global suppression strategy potentially brittle and possibly hiding legitimate permission flows that tests are intended to validate.
- Should notification suppression be applied globally via profile preferences to ensure suite stability, or retained per‑test through capabilities to preserve visibility?
- How can per‑test control be implemented given the differing preference keys and capability names for Chrome and Firefox?
- What verification steps confirm that suppressing notifications does not interfere with legitimate permission flows that tests are meant to exercise?