【发布时间】:2016-05-11 23:41:48
【问题描述】:
尝试遵循here 和here 列出的示例,以确保我将结果报告放入的目录始终存在于给定用户中。
new File(sampleFolder).mkdir();
sampleFolder 在 Eclipse 调试器中显示为 "C:\Users\CurrentUser\workspace\Automation_Framework//Reports//output//TestCasesHtmlReports//"
并且由变量定义填充
public static String sampleFolder = System.getProperty("user.dir") + "//Reports//output//TestCasesHtmlReports//";
但是,当我运行脚本时,没有创建文件夹结构,有什么想法我做错了吗?我需要以管理员身份运行 Eclipse 吗?
【问题讨论】:
-
您应该在 windows 中将 '//' 更改为 '\\'。
-
@SureshKoya 不是'\'吗?也可以使用绝对路径创建
C:/Users/CurrentUser/workspace/Automation_Framework/Reports/output/TestCasesHtmlReports/ -
您不能只输入一个反斜杠。要在路径中输入反斜杠,您需要使用另一个反斜杠对其进行转义。
标签: javascript eclipse windows selenium