Im Automation developer, Im trying using python, chrome driver,selenium >> to allow microphone in browser.
when i run my selenium tests locally, it works ok but when i run it remotely the microphone is still disabled when i run locally, i use chrome driver, with chrome version 113 i use in chrome options "--use-fake-ui-for-media-stream" and some other options ofcourse.
and my selenium tests passed successfully, and microphone is enabled
when i run chrome remotely on selenoid server, again test run successfully, but microphone is disabled i used same options like i used locally with the "--use-fake-ui-for-media-stream" option as well
this is how i initiate the deriver remotely:
webdriver.Remote(
desired_capabilities=capabilities,
command_executor=SelenoidServer.selenoid_server_path,
options=chrome_options,
the desired cap in remote are:
"browserName": "chrome",
"browserVersion": "latest-stable",
"selenoid:options": {"enableVNC": True, "enableVideo": True},
The options for local and remotely are:
"--ignore-certificate-errors",
# "--incognito",
"--no-sandbox",
"--no-default-browser-check",
"--disable-gpu",
"--disable-extensions",
"--disable-default-apps",
"--disable-web-security",
"--disable-infobars",
"--disable-dev-shm-usage",
"--disable-translate",
"--disable-webgl",
"--start-maximized",
"--use-fake-ui-for-media-stream",
experimenral options:
"profile.default_content_setting_values.media_stream_mic": 2,
"profile.default_content_setting_values.media_stream_camera": 2,
"profile.default_content_setting_values.geolocation": 2,
"profile.default_content_setting_values.notifications": 2,
"profile.default_content_settings.popups": 2,
"plugins.plugins_disabled": "Chrome PDF Viewer, Adobe Flash Player",
"credentials_enable_service": "false",
"profile.password_manager_enabled": "false",
"download.prompt_for_download": "false",
"enableNetwork": "true",
"download.default_directory": str(TEMP_FOLDER_PATH),
this is how i run it locally:
Chrome(service=Service(ChromeDriverUtil.chromedriver_path),
options=chrome_options)
in snapshot on right side you can see the browser in local run, that we have no warnning on the mic button, while on the left side when we run remotly we can see the warning on the button
can anyone help with this ?
try this with your user data path
or this
and this
also you could try with older versions of selenium-chromedriver-chrome browser, using executable path and binary path
Hope it's somehow useful