Collections:
Test Edge with Chrome WebDriver
How to create a test program for Microsoft Edge with Chrome WebDriver with Selenium Java API?
✍: FYIcenter.com
Microsoft Edge is compatible with Chrome WebDriver, you can test Web applications
with the Edge browser using the Chrome WebDriver, instead of the Edge WebDriver.
C:\fyicenter> type EdgeWithChromeDriver.java import org.openqa.selenium.*; import org.openqa.selenium.chrome.*; public class EdgeWithChromeDriver { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "\\fyicenter\\selenium\\edgedriver\\MicrosoftWebDriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://www.google.com"); driver.quit(); } }
Note that the "webdriver.chrome.driver" system property is hardcoded to connect to the Edge browser.
Compile and run it with the Selenium Client JAR file:
C:\fyicenter> javac -classpath \ \fyicenter\selenium\java\client-combined-3.141.59.jar \ EdgeWithChromeDriver.java C:\fyicenter> java -classpath \ .;\fyicenter\selenium\java\client-combined-3.141.59.jar;\ \fyicenter\selenium\java\libs\guava-25.0-jre.jar;\ \fyicenter\selenium\java\libs\okhttp-3.11.0.jar;\ \fyicenter\selenium\java\libs\okio-1.14.0.jar;\ \fyicenter\selenium\java\libs\commons-exec-1.3.jar \ EdgeWithChromeDriver [13:29:47.086] - Listening on http://localhost:6947/ 1:29:50 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS [13:29:52.276] - Stopping server.
You see that the Edge browser is started and stopped correctly with no errors. This confirms that you can use Chrome WebDriver to connect to Microsoft Edge Driver.
Â
⇒ Compatibility of WebDriver Java API for Edge
⇠Match Microsoft Edge Driver version with Edge
⇑ Starting with Selenium WebDriver Client Java API
⇑⇑ Selenium Tutorials
2020-01-21, 1263👍, 0💬
Popular Posts:
How to call JMeter command in a Windows batch file? I want to create a single batch job to run JMete...
What are JMeter command line options? You can get see JMeter command line options by running this co...
How to use HTTP protocol to post an XML message to a server? You can follow this tutorial to post an...
How to access Response Status Code 400 as Success? My sampler failed, because the server returns the...
How to valid UUID/GUID strings? In order to help your programming or testing tasks, FYIcenter.com ha...