Unable to start Edge Chromium browser from script

Hi, I’m trying to open Edge Chromium browser using the script. My test requirement is to run the test in Chrome and then within the test, I need to open the Edge Chromium browser, perform some actions and then close it.
I am using the following code to open edge -

import com.kms.katalon.core.webui.driver.DriverFactory
import org.openqa.selenium.WebDriver
import org.openqa.selenium.remote.RemoteWebDriver
import org.openqa.selenium.edge.EdgeDriver

WebDriver ed = new EdgeDriver("")
DriverFactory.changeWebDriver(ed)
WebUI.navigateToUrl(“www.google.com”)

I get this error everytime -
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.edge.EdgeDriver(java.lang.String)

Please let me know if my approach is wrong. How can I open Edge Chromium using the script ? If my approach is fine, then how should I resolve this constructor issue ?

Thanks,
Gurleen

as description error sugested : there is no method new EdgeDriver("")
try without that String:

import com.kms.katalon.core.webui.driver.DriverFactory
import org.openqa.selenium.WebDriver
import org.openqa.selenium.remote.RemoteWebDriver
import org.openqa.selenium.edge.EdgeDriver

WebDriver ed = new EdgeDriver()
DriverFactory.changeWebDriver(ed)
WebUI.navigateToUrl(“www.google.com”)

Thank you so much for your response. Actually, I was giving driver executable path in those strings. Forgot to mention here. I just tried removing that and figured out now that I should set the driver path first like this - System.setProperty(“webdriver.edge.driver”,“my path here”); It works now. Thank you so much again.!

1 Like