I'm automating a flow that involves joining a Microsoft Teams meeting using Selenium. When navigating to the meeting URL, a browser pop-up appears asking: to open in desktop or Cancel. i want to ignore this pop up in selenium python. I've tried setting Chrome preferences like:
# Supress popup requests for notifications that disturb flows, allow use microphone and camera devices
options.add_experimental_option("prefs", {"profile.default_content_setting_values.notifications": 2,
'profile.default_content_setting_values.media_stream_mic': 1,
'profile.default_content_setting_values.media_stream_camera': 1,
'profile.default_content_setting_values.popups': 2,
"protocol_handler.excluded_schemes": {
"msteams": True} # block attempts to open Teams locally
})
But the pop-up still appears and blocks the automation. Since this is a browser-level prompt (not part of the DOM), Selenium can't interact with it directly.
I also tried to add this to the url.
url = self.teams_meeting['joinWebUrl'] +'&launchApp=false'
Is there a way to suppress or auto-dismiss this pop-up using Chrome options,or any other workaround?
My solution is to press Enter, which cancels the popup.
import pyautogui
pyautogui.press('enter')