Edge Chromium : No matching capabilities found

Hello,

I try to start Edge Chromium with a custom Keyword but there is an error when launching browser.
I use Katalon 7.7.0, Edge Chromium 85.0.564.51 and Microsoft Edge Chromium WebDriver 85.0.564.51

The code for my custom keyword is the following:

def startBrowser() {
WebUIDriverType executedBrowser = DriverFactory.getExecutedBrowser()
switch(executedBrowser) {

  case WebUIDriverType.EDGE_CHROMIUM_DRIVER:
  	String CustomDownloadPath=GlobalVariable.StoragePath+GlobalVariable.DownloadDir
  	Map<String, Object> edgePrefs = new HashMap<String, Object>()
  	edgePrefs.put("profile.default_content_settings.popups", 0);
  	edgePrefs.put("download.default_directory", CustomDownloadPath)
  	edgePrefs.put("download.prompt_for_download", false)
  	
  	ChromeOptions chromeOptions = new ChromeOptions();
  	chromeOptions.addArguments("--disable-infobars")
  	chromeOptions.addArguments("--start-maximized")
  	chromeOptions.setExperimentalOption("prefs", edgePrefs);
  	System.setProperty("webdriver.edge.driver", DriverFactory.getEdgeChromiumDriverPath())
  	
  	EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);
  	WebDriver driver = new EdgeDriver(edgeOptions);
  	DriverFactory.changeWebDriver(driver);

  	break;

  default:
  	WebUI.openBrowser(null);

}
}

I always have the following error:

org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘W10-KATALON’, ip: ‘xx.xx.xx.xx’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: EdgeDriver
remote stacktrace: Backtrace:
Ordinal0 [0x00007FF60C91A3D2+4105170]
Ordinal0 [0x00007FF60C7EF7D9+2881497]
Ordinal0 [0x00007FF60C660217+1245719]
Ordinal0 [0x00007FF60C5DC8BF+706751]
Ordinal0 [0x00007FF60C5DB05F+700511]
Ordinal0 [0x00007FF60C5B74B3+554163]
Ordinal0 [0x00007FF60C5B824E+557646]
Ordinal0 [0x00007FF60C80BEB6+2997942]
GetHandleVerifier [0x00007FF60CA5CA33+1202179]
GetHandleVerifier [0x00007FF60CA717D1+1287585]
GetHandleVerifier [0x00007FF60CA5D687+1205335]
Ordinal0 [0x00007FF60C800741+2950977]
Ordinal0 [0x00007FF60C80DCF9+3005689]
Ordinal0 [0x00007FF60C822928+3090728]
BaseThreadInitThunk [0x00007FF950B26FD4+20]
RtlUserThreadStart [0x00007FF95161CEC1+33]

at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:141)
at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:130)
at packageStartBrowser.startBrowserWithProfile.startBrowser(startBrowserWithProfile.groovy:112)
at packageStartBrowser.startBrowserWithProfile.invokeMethod(startBrowserWithProfile.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
at Open_browser.run(Open_browser:16)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:339)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:330)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:309)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:235)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1600765938035.run(TempTestCase1600765938035.groovy:25)

Can someone help me with this error ? What’s wrong with my code ?

Thanks

Hello,

I tried setting the Edge Chromium options in another way:

@Keyword
def startBrowser() {
WebUIDriverType executedBrowser = DriverFactory.getExecutedBrowser();
switch(executedBrowser) {
case WebUIDriverType.EDGE_CHROMIUM_DRIVER:
String CustomDownloadPath=GlobalVariable.StoragePath+GlobalVariable.DownloadDir;

  	Map<String, Object> edgePrefs = new HashMap<String, Object>();
  	edgePrefs.put("profile.default_content_settings.popups", 0);
  	edgePrefs.put("download.default_directory", CustomDownloadPath);
  	edgePrefs.put("download.prompt_for_download", false);				

  	EdgeOptions options = new EdgeOptions();
  	options.setCapability("prefs", edgePrefs);
  	options.setCapability("useAutomationExtension", false);
  	System.setProperty("webdriver.edge.driver", DriverFactory.getEdgeChromiumDriverPath());
  	WebDriver driver = new EdgeDriver(options);

  	DriverFactory.changeWebDriver(driver);
  	
  	break;

  default:
  	WebUI.openBrowser(null);

}
}

There are no more errors and the Edge Chromium browser is started.
But the download path is not the right one: the one I defined in the options is not taken into account.

Do you have an idea to help me?
Thanks and regards,

  Vincent

Thanks to Edge Chromium default download directory
we know how the code should look like:

case WebUIDriverType.EDGE_CHROMIUM_DRIVER:
System.setProperty(‘webdriver.edge.driver’, DriverFactory.getEdgeChromiumDriverPath())

    EdgeOptions options = new EdgeOptions()

    Map<String, Object> prefs = new HashMap<String, Object>()

    prefs.put('profile.default_content_settings.popups', 0)

    prefs.put('download.default_directory', GlobalVariable.downloadFolder)

    prefs.put('download.prompt_for_download', false)
	
	
	Map<String, Object> edgeOptions = new HashMap<String, Object>()
	
	edgeOptions.put('prefs', prefs)
	
	edgeOptions.put('useAutomationExtension', false)
	
	edgeOptions.put('args', ["--no-sandbox", "--disable-dev-shm-usage"])
	
	
	options.setCapability('ms:edgeChrominum', true)
	
	options.setCapability('ms:edgeOptions', edgeOptions)
	

    driver = new EdgeDriver(options)
    
    break
	
default:
    WebUI.openBrowser('')}

// let Katalon Studio to use the WebDriver created here
DriverFactory.changeWebDriver(driver)