SOLVED

Edge Preference setup for Selenium

%3CLINGO-SUB%20id%3D%22lingo-sub-1450995%22%20slang%3D%22en-US%22%3EEdge%20Preference%20setup%20for%20Selenium%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450995%22%20slang%3D%22en-US%22%3E%3CP%3ETeam%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20selenium%20execution%20we%20need%20to%20setup%20browser%20preferences%20to%20avoid%20the%20notification%20displaying%20while%20running%20the%20test%20in%20EDGE%20browser%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20we%20have%20any%20edgeoptions%20available.%20we%20need%20settings%20at%20least%20for%20following%20notifications%3C%2FP%3E%3CP%3E1.%26nbsp%3Bmultiple%20file%20download%20notification%3C%2FP%3E%3CP%3E2.%20allow%20notifications%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ESankar%20Palanisamy%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1453976%22%20slang%3D%22en-US%22%3ERe%3A%20Edge%20Preference%20setup%20for%20Selenium%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1453976%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693990%22%20target%3D%22_blank%22%3E%40sankar6270%3C%2FA%3E%26nbsp%3BI%20think%20this%20article%20will%20help%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fwebdriver-chromium%3Ftabs%3Dc-sharp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fwebdriver-chromium%3Ftabs%3Dc-sharp%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E-John%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1456134%22%20slang%3D%22en-US%22%3ERe%3A%20Edge%20Preference%20setup%20for%20Selenium%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1456134%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%26nbsp%3BThanks%20a%20lot.%20Actually%20i%20was%20tried%20with%20selenium%26nbsp%3B%3CSPAN%3E%203.141.59.%20now%20it%20is%20working%20fine%20with%26nbsp%3B4.0.0-alpha-6.%20Because%20setExperimentalOption%20added%20in%204.0.0-alpha.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Emy%20code%20be%20like%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EHashMap%3CSTRING%3E%20edgePrefs%20%3D%20new%20HashMap%3CSTRING%3E()%3B%0AedgePrefs.put(%22profile.default_content_settings.popups%22%2C%200)%3B%0AedgePrefs.put(%22profile.default_content_setting_values.notifications%22%2C%202)%3B%20%20%0AedgePrefs.put(%22profile.default_content_setting_values.automatic_downloads%22%20%2C%201)%3B%20%20%0AedgePrefs.put(%22profile.content_settings.pattern_pairs.*%2C*.multiple-automatic-downloads%22%2C1)%3B%0AEdgeOptions%20egdeOptions%20%3D%20new%20EdgeOptions()%3B%0AegdeOptions.setExperimentalOption(%22prefs%22%2CedgePrefs)%3B%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThanks%20Again%26nbsp%3B%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%26nbsp%3B.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Team,

 

For selenium execution we need to setup browser preferences to avoid the notification displaying while running the test in EDGE browser

 

Please let me know if we have any edgeoptions available. we need settings at least for following notifications

1. multiple file download notification

2. allow notifications?

 

Thanks,

Sankar Palanisamy

 

 

2 Replies
Highlighted
Best Response confirmed by fawkes (Microsoft)
Highlighted

@johnjansen Thanks a lot. Actually i was tried with selenium  3.141.59. now it is working fine with 4.0.0-alpha-6. Because setExperimentalOption added in 4.0.0-alpha.

my code be like

HashMap<String, Object> edgePrefs = new HashMap<String, Object>();
edgePrefs.put("profile.default_content_settings.popups", 0);
edgePrefs.put("profile.default_content_setting_values.notifications", 2);		
edgePrefs.put("profile.default_content_setting_values.automatic_downloads" , 1);		
edgePrefs.put("profile.content_settings.pattern_pairs.*,*.multiple-automatic-downloads",1);
EdgeOptions egdeOptions = new EdgeOptions();
egdeOptions.setExperimentalOption("prefs",edgePrefs);

Thanks Again @johnjansen .