I'm trying to use Selenium webdrivers but every time I run the program it happens like this:
Here is the code of the program:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import static org.openqa.selenium.chrome.ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY;
public class TestSelenium {
public static void main(String[] args) {
System.setProperty("webdriver.edge.driver", "C:\\Users\\lucao\\Downloads\\selenium-java-4.0.0\\selenium-edge-driver-4.0.0.jar");
WebDriver wd = new EdgeDriver();
String baseUrl = "https://www.google.com";
wd.get(baseUrl);
EdgeDriver driver=new EdgeDriver();
driver.get("www.google.com");
}
}
Please match the browser version and driver version also match the OS, arch, OS version.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.