作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想通过应用对象存储库概念在 Chrome 驱动程序中打开 url。下面给出的是我的 selenium 程序,其中包含两个文件,一个是 testng 文件,另一个是 config.property 文件chromedriver="E:\\selenium bwosers\\chromedriver.exe"
url =“https://www.google.co.in”
我将上面的程序保存为配置文件夹中的config.property
package sele_prac_pkg;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class Object_repo
{
@Test
public void f() throws Exception
{
File file=new File("./configuration/config.property");
FileInputStream fis=new FileInputStream(file);
Properties pro=new Properties();
pro.load(fis);
String url_var=pro.getProperty("url");
String chromedriver_var=pro.getProperty("chromedriver");
System.setProperty("webdriver.chrome.driver",chromedriver_var);
WebDriver driver=new ChromeDriver();
driver.get(url_var);
}
}
当我执行上面的代码时,它shwoig java.lang.IllegalStateException:驱动程序可执行文件不存在错误
最佳答案
有两件事
关于java.lang.IllegalStateException : The driver executable does not exist chrome driver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38283631/
我是一名优秀的程序员,十分优秀!