【发布时间】:2019-09-21 23:17:54
【问题描述】:
我收到此错误。
线程“main”中的异常 java.lang.IllegalStateException:驱动程序 不可执行:/home/hashconnect/Desktop/Priya 错误表/selenium/chromedriver.exe
在该项目中创建一个新文件夹“Drivers”并将位置更改为“.\drivers\chromedriver.exe”
这是我的代码:
package demo;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class test {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","/home/hashconnect/Desktop/Priya bugsheet/selenium/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
Thread.sleep(5000);
}
}
预期:系统应该启动 chrome 浏览器
实际: 它显示错误消息:
线程“main”中的异常 java.lang.IllegalStateException:驱动程序 不可执行:/home/hashconnect/Desktop/Priya 错误表/selenium/chromedriver.exe
【问题讨论】:
标签: selenium-webdriver selenium-chromedriver illegalstateexception