MOB-38657: Add unhandledPromptBehavior: ignore capability across all browser options#1976
Open
MOB-38657: Add unhandledPromptBehavior: ignore capability across all browser options#1976
Conversation
…browser options
**Root Cause**:
- unhandledPromptBehavior: ignore was inconsistently applied — only Chrome had it in its options method (_get_chrome_options); Firefox had it buried in profile methods only.
- Edge, WebKitGTK (Safari/MiniBrowser), and the ArgOptions fallback (triggered when no explicit browser: is set in YAML and browser is chosen externally, e.g. via BlazeMeter UI) had no unhandledPromptBehavior set at all
The ArgOptions path is the most impactful gap — any remote cloud run without an explicit browser: in YAML silently skipped this capability.
**Fix**:
- Added options.set_capability('unhandledPromptBehavior', 'ignore') to all browser options methods in generator.py:
- _get_firefox_options() — was missing; only existed in profile methods
- _get_edge_options() — was entirely absent
- _get_webkitgtk_options() — was entirely absent
- ArgOptions fallback in _get_options() — was entirely absent; this covers remote runs where browser is selected outside of taurus YAML (e.g. BlazeMeter cloud UI)
- Chrome (_get_chrome_options) was already correct — no change
**Test Cases Covered**:
- Chrome (local) — capability already present via _get_chrome_options; unchanged
- Firefox (local) — capability now set at options level, consistent with Chrome
- Edge (local, Selenium 4+) — capability now set via _get_edge_options
- Safari/MiniBrowser (remote BlazeMeter grid) — capability now set via _get_webkitgtk_options
Remote run with no explicit browser in YAML (e.g. BlazeMeter cloud) — capability now set via ArgOptions fallback; this was the primary reported failure case (test_requests.py showed ArgOptions() with no unhandledPromptBehavior)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1976 +/- ##
==========================================
- Coverage 89.91% 89.85% -0.06%
==========================================
Files 71 71
Lines 20182 20182
==========================================
- Hits 18145 18132 -13
- Misses 2037 2050 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause:
Fix:
Test Cases Covered:
Remote run with no explicit browser in YAML (e.g. BlazeMeter cloud) — capability now set via ArgOptions fallback; this was the primary reported failure case (test_requests.py showed ArgOptions() with no unhandledPromptBehavior)
Each PR must conform to Developer's Guide.
Quick checklist:
site/dat/docs/changesdirectory, one-line note of change inside