Forum Discussion

panirban's avatar
panirban
Copper Contributor
Jan 06, 2020

Edge Chromium Automation for MAC and Windows

Hi,

Need help regarding Edge chromium  Beta selenium java automation. 

Using below code I am able to launch Edge Chromium beta(79.0.309.58) in windows 10 system.

 

 

if(browserName.equals("edge")){
            System.setProperty("webdriver.edge.driver", "<windowsMsEdgeChromiumDriverPath>");
            final ChromeOptions chromeOptions = new ChromeOptions();
            chromeOptions.setBinary("C:\\Program Files (x86)\\Microsoft\\Edge Beta\\Application\\msedge.exe");
            chromeOptions.setExperimentalOption("useAutomationExtension", false);
            chromeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));            
            final EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);            
            final WebDriver webDriver = new EdgeDriver(edgeOptions);
            webDriver.manage().window().maximize();
            webDriver.manage().deleteAllCookies();
            webDriver.get(url);
	}

 

 

 But Using the below code I am facing difficulties to lunch Edge Chromium beta(79.0.309.58) in MAC

 

 

if(browserName.equals("edge")) {
System.setProperty("webdriver.edge.driver", "/Users/macUser/Documents/projects/projectName/driver/msedgedriver");
final ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("/Application/Microsoft Edge Beta.app");
chromeOptions.setExperimentalOption("useAutomationExtension", false);
chromeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
final EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);
final WebDriver webDriver = new EdgeDriver(edgeOptions)
webDriver.manage().window().maximize();
webDriver.manage().deleteAllCookies();
webDriver.get(url);
}

 

 

In below line 

final EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);

getting below error 

 

can not resolve merge(org.openqa.selenium.chrome.ChromeOptions)

 

 in mac o.s

 

But if I use

 

            final EdgeOptions edgeOptions = new EdgeOptions()

 

instead of 

final EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions); 

then In MAC O.S getting below Exception

 

org.openqa.selenium.WebDriverException: unknown error: cannot find Microsoft Edge binary

 

 

Can any one help me regarding thing.

Thanks!

3 Replies

  • johnjansen's avatar
    johnjansen
    Former Employee

    Hi panirban, two things jump out immediately, so can you check these just to make sure?

     

    The path to msedge needs to be the full path, can you please make sure you use this:

     

    ā€œ/Applications/Microsoft Edge Beta .app/Contents/MacOS/Microsoft Edge Beta"

     

    and also, note that it should be Applications, not Application

     

    Let us know if that works.

     

    -John

    • panirban's avatar
      panirban
      Copper Contributor

      johnjansen 

      Hi,

      After changing binary path to 

      chromeOptions.setBinary("/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta");

      still it didn't worked. Same error getting

      • panirban's avatar
        panirban
        Copper Contributor

        @johnjansen

         

        Hi, its working after the using full path as per your suggestion. We need to use latest selenium - server.

        I was using old selenium- server for MAC thats why earlier it was failing.

         

        Thanks for your help

Resources