How to enable 'Mircophone' access in Edge browser using Selenium?

%3CLINGO-SUB%20id%3D%22lingo-sub-1149633%22%20slang%3D%22en-US%22%3EHow%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1149633%22%20slang%3D%22en-US%22%3E%3CP%3EWebDriverManager.EdgeDriver().setup()%3B%3CBR%20%2F%3EEdgeOptions%20options%20%3D%20new%20EdgeOptions()%3B%3CBR%20%2F%3EedgeOptions.AddAdditionalCapability(%22dom.webnotifications.enabled%22%2C1)%3B%3CBR%20%2F%3EedgeOptions.AddAdditionalCapability(%22permissions.default.microphone%22%2C%201)%3B%3CBR%20%2F%3EedgeOptions.AddAdditionalCapability(%22permissions.default.camera%22%2C%201)%3B%3CBR%20%2F%3Edriver%20%3D%20new%20EdgeDriver(options)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20above%20code%20is%20not%20working%3C%2FP%3E%3CP%3EPlz%20give%20solution%20to%20auto%20allow%20mic%2Fcamera%20using%20selenium%20automation%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1152261%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1152261%22%20slang%3D%22en-US%22%3E%3CP%3Ethe%20solution%20i%20s%20only%20for%20C%23%20code%20bcz%20im%20working%20on%20VS%20plz%20give%20solution%20ASAP%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544245%22%20target%3D%22_blank%22%3E%40Madhusudan26%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1154037%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1154037%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544245%22%20target%3D%22_blank%22%3E%40Madhusudan26%3C%2FA%3E%26nbsp%3Bhave%20you%20ever%20seen%20this%20work%20with%20other%20webdriver%20versions%20(like%20with%20the%20old%20Edge%2C%20Firefox%2C%20or%20Chrome)%3F%20When%20I%20look%2C%20it%20does%20not%20look%20like%20this%20should%20work%2C%20so%20I'm%20curious%20about%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-John%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1154477%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1154477%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F318459%22%20target%3D%22_blank%22%3E%40johnjansen%3C%2FA%3E%3CSTRONG%3EFor%20C%23%20code%20in%20visual%20studio%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EFor%20the%20chrome%20below%20things%20are%20working%20and%20not%20shown%20micro%20phone%20allow%20notification%20by%20using%20below%20code%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EChromeOptions%20CHoptions%20%3D%20new%20ChromeOptions()%3B%3CBR%20%2F%3ECHoptions.AddArguments(%22use-fake-ui-for-media-stream%22)%3B%3CBR%20%2F%3ECHoptions.AddArguments(%22use-fake-device-for-media-stream%22)%3B%3CBR%20%2F%3Edriver%20%3D%20new%20ChromeDriver(CHoptions)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20in%20new%20Microsoft%20edge%20chromium%20version%2079%20%26amp%3B%2080%2C%20i'm%20using%20but%20not%20find%20any%20solution%20on%20to%20allow%20microphone%20notification%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1171015%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1171015%22%20slang%3D%22en-US%22%3EPlz%20let%20give%20solution%20to%20any%20one%20on%20the%20above%20query%20ASAP.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260699%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260699%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20John%3CBR%20%2F%3Eplease%20give%20the%20solution%20of%20above%20comment.%3CBR%20%2F%3EAnd%20tell%20me%20its%20issue%20or%20bug%20in%20Microsoft%20edge%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1265252%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20enable%20'Mircophone'%20access%20in%20Edge%20browser%20using%20Selenium%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1265252%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544245%22%20target%3D%22_blank%22%3E%40Madhusudan26%3C%2FA%3E%26nbsp%3Bif%20those%20ChromeOptions%20work%20with%20Chrome%2C%20then%20they%20should%20work%20with%20Edge.%20You%20do%20need%20to%20be%20either%20running%20Selenium%204%20alpha%205%20OR%20if%20you're%20still%20on%20Selenium%203%2C%20we%20published%20a%20new%20nuget%20package%20that%20can%20help%20with%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fwebdriver-chromium%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fwebdriver-chromium%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252Fmicrosoft%252Fedge-selenium-tools%26amp%3Bdata%3D04%257C01%257CJohn.Jansen%2540microsoft.com%257Cdf0519f9b2804559d3a008d7d4c25986%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637211803563577738%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C-1%26amp%3Bsdata%3DtpxN902e1%252BDqz4NTwgVO8g6kutPGpB4EQ5ukL49KBnY%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2Fedge-selenium-tools%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20it%20doesn't%20work%20for%20you%2C%20please%20include%20the%20code%20you%20are%20writing%20to%20make%20it%20work%20in%20Edge.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-John%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

WebDriverManager.EdgeDriver().setup();
EdgeOptions options = new EdgeOptions();
edgeOptions.AddAdditionalCapability("dom.webnotifications.enabled",1);
edgeOptions.AddAdditionalCapability("permissions.default.microphone", 1);
edgeOptions.AddAdditionalCapability("permissions.default.camera", 1);
driver = new EdgeDriver(options);

 

But above code is not working

Plz give solution to auto allow mic/camera using selenium automation

6 Replies
Highlighted

the solution i s only for C# code bcz im working on VS plz give solution ASAP@Madhusudan26 

Highlighted

@Madhusudan26 have you ever seen this work with other webdriver versions (like with the old Edge, Firefox, or Chrome)? When I look, it does not look like this should work, so I'm curious about that.

 

-John 

Highlighted

@johnjansenFor C# code in visual studio

For the chrome below things are working and not shown micro phone allow notification by using below code

ChromeOptions CHoptions = new ChromeOptions();
CHoptions.AddArguments("use-fake-ui-for-media-stream");
CHoptions.AddArguments("use-fake-device-for-media-stream");
driver = new ChromeDriver(CHoptions);

 

But in new Microsoft edge chromium version 79 & 80, i'm using but not find any solution on to allow microphone notification

Highlighted
Plz let give solution to any one on the above query ASAP.
Highlighted

Hello John
please give the solution of above comment.
And tell me its issue or bug in Microsoft edge

Highlighted

@Madhusudan26 if those ChromeOptions work with Chrome, then they should work with Edge. You do need to be either running Selenium 4 alpha 5 OR if you're still on Selenium 3, we published a new nuget package that can help with that.

 

https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium

https://github.com/microsoft/edge-selenium-tools

 

If it doesn't work for you, please include the code you are writing to make it work in Edge.

 

-John