ниже ошибки, я так запутался, что пробовал по-разному, и моя ОС ma c
current dir = /Users/rafa/eclipse-workspace/FirstSelenium_2
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: /Users/rafa/eclipse-workspace/FirstSelenium_2//Users/rafa/eclipse-workspace/FirstSelenium_2/src/chromedriver
at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:146)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:141)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:159)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:355)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at Test2.main(Test2.java:14)
код:
public static void main(String[] args) {
String dir = System.getProperty("user.dir");
System.out.println("current dir = " + dir);
//to open browser
System.setProperty("webdriver.chrome.driver","/Users/rafa/eclipse-workspace/FirstSelenium_2/src/chromedriver");
WebDriver d=new ChromeDriver();
String actualurl="https://www.mycontactform.com";
//open url
d.get(actualurl);
//printing the title of page
String title=d.getTitle();
System.out.println(title);
//printing the actual url
System.out.println("actual url: "+actualurl);
//printing the current url
System.out.println("current url: "+d.getCurrentUrl());
//maximize the window
d.manage().window().maximize();
}
У меня есть драйвер в каталоге, но по-прежнему есть эта ошибка