我们正在运行TeamCity的Java-Cucumber-Maven自动化测试脚本。到目前为止,此方法运行良好,但是我们当前的测试要求下载几个.CSV文件,以供脚本进行分析。有一个
ReadCsvFiles.java
我们代码中的文件,它指示了下载文件的位置。...易于在本地运行测试,但是TeamCity中构建代理的路径确实存在问题。
public class ReadCsvFiles {
//public static String sFileLocation = "C:\\Users\\ankit.bisht\\Downloads\\";
public static String sFileLocation = "C:\\BuildAgent\\temp\\buildTmp\\";
//public static String sFileLocation = "//users/redmayned//Downloads/";
public static void depositsHeldReports() throws Throwable {
String csvFile = sFileLocation + "DepositsHeld.csv";
CSVReader reader = null;
try {
reader = new CSVReader(new FileReader(csvFile));
String[] column;
boolean doesExist = false;
while ((column = reader.readNext()) != null) {
注释掉的条目用于本地窗口和本地OSX。中档选项只是我们尝试过的众多选项之一,所有选项都会导致错误消息;
java.io.FileNotFoundException: C:\BuildAgent\temp\buildTmp\DepositsHeld.csv (The system cannot find the file specified)
任何人都可以挽救我的理智吗?
谢谢
大卫