Java 在Maven Selenium项目的TFS中未找到chromedriver可执行文件
在TFS2015中通过Maven build(POM.xml)运行Java Selenium测试时,出现错误。我知道错误是针对chromedriver可执行文件的,但不确定应该给出什么路径 当我运行eclipse-D:\DATA\chromedriver\u win32\chromedriver.exe时,当前使用此路径 要运行TFS,我应该做哪些更改 另外,Maven设置是在TFS和POM.xml中完成的,我提到了所有依赖项。因此,对于chromedriver.exe,我必须在TFS中进行一些额外的设置。请帮忙 我得到的错误是-Java 在Maven Selenium项目的TFS中未找到chromedriver可执行文件,java,maven,selenium,tfs,Java,Maven,Selenium,Tfs,在TFS2015中通过Maven build(POM.xml)运行Java Selenium测试时,出现错误。我知道错误是针对chromedriver可执行文件的,但不确定应该给出什么路径 当我运行eclipse-D:\DATA\chromedriver\u win32\chromedriver.exe时,当前使用此路径 要运行TFS,我应该做哪些更改 另外,Maven设置是在TFS和POM.xml中完成的,我提到了所有依赖项。因此,对于chromedriver.exe,我必须在TFS中进行一些
java.lang.IllegalStateException: The driver executable does not exist: D:\DATA\chromedriver_win32\chromedriver.exe
at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
xml如下所示-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Maven_demo</groupId>
<artifactId>Maven_Project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Maven_Project</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-plugin-plugin
</artifactId>
<versionRange>
[3.2,)
</versionRange>
<goals>
<goal>descriptor</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
4.0.0
Maven_演示
马文努项目
0.0.1-快照
马文努项目
http://maven.apache.org
org.seleniumhq.selenium
硒爪哇
3.11.0
测验
org.testng
testng
6.14.2
测验
朱尼特
朱尼特
测验
org.eclipse.m2e
生命周期映射
1.0.0
org.apache.maven.plugins
maven插件
[3.2,)
描述符
org.apache.maven.plugins
maven编译器插件
3.1
1.7
1.7
朱尼特
朱尼特
4.11
在创建ChromeDriver的新实例之前,您可以尝试将以下代码添加到Selenium程序中:
System.setProperty("webdriver.chrome.driver",
"C:\\chromedriver.exe");
如果上述解决方案不起作用,请尝试根据构建代理计算机上的chrome浏览器版本下载/更改chrome驱动程序
有用链接:
D:\DATA\chromedriver\u win32
中?@Cece Dong-MSFT-否,这是我的本地计算机路径。我必须在那里提供构建代理计算机路径?对于chrome浏览器二进制文件。它将从何处选择?检查此处: