I am testing my website using Selenium and I am able to open chrome with --auto-select-desktop-capture-source="tab_name" and select the tab when screen share is enabled. Now I want the audio playing in the tab to be in my stream along with the video. While doing it manually there is a checkbox which enables audio sharing but is there something which can help enable it from Selenium?
Here is a fiddle: https://jsfiddle.net/john_vera/yr2k9xob/5/ Notice the Share Audio checkbox after selecting chrome tab in the dialog. I want to check that from Selenium.
You could create an custom chromium build and implement an bypass for this dialog. To build chromium you can use these instructions (for windows): Here
Here the bypass in file display_media_access_handler.cc:
Look for this line:
// Orignal code
pending_request.picker->Show(picker_params, std::move(source_lists), std::move(done_callback));
And replace it with this
// Bypass dialog
content::DesktopMediaID screenSource(content::DesktopMediaID::TYPE_SCREEN, content::DesktopMediaID::kNullId, web_contents);
screenSource.audio_share = true;
OnPickerDialogResults(web_contents, screenSource);
// End of bypass
I testet it with Chromium Version 84.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With