1
我在我的WebDriver测试中使用西班牙语UTF-8字符,如果从Eclipse运行,它工作正常,但如果我尝试通过Ant运行相同的测试失败,因为它无法找到一些特殊元素字符。我想通过编码搞砸了,但我似乎无法正确设置它。我尝试了以下步骤,但无济于事Ant jUnit WebDriver - 文件编码
<junit printsummary="yes" haltonfailure="no" fork="yes">
<jvmarg value="-Dfile.encoding=UTF-8"/>
<classpath>
<pathelement location="${bin}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</classpath>
<test name="com.yourcompany.selenium.MyTest" haltonfailure="no" todir="${report}/xml" outfile="TEST-result">
<formatter type="xml" />
</test>
</junit>
试图通过将编码值添加到命令行,但测试仍然失败。