Collections:
Edge WebDriver Test with Selenium Java API
How to create a test program using Edge WebDriver with Selenium Java API?
✍: FYIcenter.com
Here is a simple test program that the Edge WebDriver Test with the Selenium Java API:
C:\fyicenter> type EdgeTest.java
import org.openqa.selenium.*;
import org.openqa.selenium.edge.*;
public class EdgeTest {
public static void main(String[] args) {
WebDriver driver = new EdgeDriver();
driver.get("http://www.google.com");
driver.quit();
}
}
Compile and run it with the Selenium Client JAR file:
C:\fyicenter> javac -classpath \ \fyicenter\selenium\java\client-combined-3.141.59.jar \ EdgeTest.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 \ EdgeTest Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.edge.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/MicrosoftWebDriver. The latest version can be downloaded from http://go.microsoft.com/fwlink/?LinkId=619687 at com.google.common.base.Preconditions.checkState(Preconditions.java:847) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:134) at org.openqa.selenium.edge.EdgeDriverService.access$000(EdgeDriverService.java:37) at org.openqa.selenium.edge.EdgeDriverService$Builder.findDefaultExecutable(EdgeDriverService.java:90) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:355) at org.openqa.selenium.edge.EdgeDriverService.createDefaultService(EdgeDriverService.java:70) ...
As you can see, we are missing the Microsoft Edge Driver. See next tutorial on how to fix it.
⇒ Use Edge WebDriver with Microsoft Edge Driver
⇐ Compatibility of WebDriver Java API for Firefox
2020-01-29, ∼2918🔥, 0💬
Popular Posts:
How to valid IP addresses? In order to help your programming or testing tasks, FYIcenter.com has des...
How to Pass Windows Environment Variable to JMeter? I want to use Windows temporary folder environme...
How to generate user birthday dates? Test user birthday dates are frequently needed in testing appli...
Where to find test data generators? FYIcenter.com has prepared a number of test data generators for ...
Where to find tutorials on Test Management? I want to know how to manage software testing documents ...