无法找到属性文件(FileNotfoundException)

时间:2012-08-22 12:57:00

标签: java ant selenium junit4

我使用ant task运行selenium脚本..使用命令提示符正常工作..但是从ant任务开始,它无法正常工作。如何解决这个问题?

 <testcase classname="junit.framework.TestSuite"    name="com.openbravo.test.integration.erp.testsuites.regression.MRC0000_Logging" time="0.0010">
  <error message="config/OpenbravoERPTest.properties (No such file or directory)"   type="java.io.FileNotFoundException">java.io.FileNotFoundException: config/OpenbravoERPTest.properties (No such file or directory)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:120)
  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:79)
 at com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest.loadProperties(OpenbravoERPTest.java:117)
 at com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest.setUpBeforeClass(OpenbravoERPTest.java:105)
 at org.eclipse.ant.internal.launching.remote.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
 at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
 at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 </error>
 </testcase>
 <system-out><![CDATA[asd
 ]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

2 个答案:

答案 0 :(得分:0)

路径名是相对的:config/OpenbravoERPTest.properties

您确定从正确的目录中的命令行执行脚本吗?

答案 1 :(得分:0)

确保包含config目录的目录位于类路径中。