TA的每日心情 | 开心 2020-6-28 13:31 |
---|
签到天数: 4 天 连续签到: 1 天 [LV.2]测试排长
|
我在Myeclipse运行selenium-RC的成功,在lib里添加了testng-results.xsl和testng-results.xml,创建了Build.xml,Myeclipse运行后提示:BUILD SUCCESSFUL。CMD运行 ant transform后,提示:- Microsoft Windows XP [Version 5.1.2600]
- (C) Copyright 1985-2001 Microsoft Corp.
- C:\Documents and Settings\Administrator>cd C:\Documents and Settings\Administrat
- or\Workspaces\MyEclipse 8.5\Test-20100611\src
- C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test-20100611\s
- rc>ant transform build.xml
- Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
- b\tools.jar
- Buildfile: C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test
- -20100611\src\build.xml
- transform:
- [xslt] Processing C:\Documents and Settings\Administrator\Workspaces\MyEcli
- pse 8.5\Test-20100611\Lib\testng-results.xml to C:\a\index.html
- [xslt] Loading stylesheet C:\Documents and Settings\Administrator\Workspace
- s\MyEclipse 8.5\Test-20100611\Lib\testng-results.xsl
- [xslt] : Error! Syntax error in 'if ($testNgXslt.testDetailsFilter) then $t
- estNgXslt.testDetailsFilter else 'FAIL,PASS,SKIP''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 23: Error parsing X
- Path expression 'if ($testNgXslt.testDetailsFilter) then $testNgXslt.testDetails
- Filter else 'FAIL,PASS,SKIP''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 23: Required attrib
- ute 'select' is missing.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 12: The method attr
- ibute of an <xsl:output> element had the value 'xhtml'. The value must be one o
- f 'xml', 'html', 'text', or qname-but-not-ncname
- [xslt] : Error! Syntax error in 'if (suite/@url) then document(suite/@url)/
- suite else suite'.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 425: Error parsing
- XPath expression 'if (suite/@url) then document(suite/@url)/suite else suite'.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 425: Required attri
- bute 'select' is missing.
- [xslt] : Error! Syntax error in 'if (test/@url) then document(test/@url)/te
- st else test'.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 694: Error parsing
- XPath expression 'if (test/@url) then document(test/@url)/test else test'.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 694: Required attri
- bute 'select' is missing.
- [xslt] : Error! Syntax error in 'if (compare($sortByStartTime, 'true') = 0)
- then @started-at else '''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 896: Error parsing
- XPath expression 'if (compare($sortByStartTime, 'true') = 0) then @started-at el
- se '''.
- [xslt] : Error! Syntax error in 'if (compare($testNgXslt.sortTestCaseLinks,
- 'true') = 0) then @name else '''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 1008: Error parsing
- XPath expression 'if (compare($testNgXslt.sortTestCaseLinks, 'true') = 0) then
- @name else '''.
- [xslt] : Error! Syntax error in 'null'.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 1015: Error parsing
- XPath expression 'null'.
- [xslt] : Error! Syntax error in 'if ($totalCount > 0) then format-number($p
- assedCount div $totalCount, '###%') else '100%''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 1090: Error parsing
- XPath expression 'if ($totalCount > 0) then format-number($passedCount div $tot
- alCount, '###%') else '100%''.
- [xslt] : Error! file:/C:/Documents%20and%20Settings/Administrator/Workspace
- s/MyEclipse%208.5/Test-20100611/Lib/testng-results.xsl: line 1090: Required attr
- ibute 'select' is missing.
- [xslt] : Fatal Error! Could not compile stylesheet
- [xslt] Failed to process C:\Documents and Settings\Administrator\Workspaces
- \MyEclipse 8.5\Test-20100611\Lib\testng-results.xml
- BUILD FAILED
- C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test-20100611\s
- rc\build.xml:10: Fatal error during transformation
- Total time: 0 seconds
- C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test-20100611\s
- rc>
复制代码 请问是怎么回事? 谢谢
ant已经配置完了,就是不知道怎么运行能出测试报告。请帮忙看下
下面是build.xml文件- <project name="Test-20100611" basedir=".">
- <property name="lib.dir" value="lib"/>
- <path id="test.classpath">
- <!-- adding the saxon jar to your classpath -->
- <fileset dir="${lib.dir}" includes="*.jar"/>
- </path>
- <target name="transform">
- <xslt in="C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test-20100611\Lib\testng-results.xml" style="C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\Test-20100611\Lib\testng-results.xsl" out="C:\a\index.html">
- <!-- you need to specify the directory here again -->
- <param name="testNgXslt.outputDir" expression="C:\a\"/>
- <classpath refid="test.classpath"/>
- </xslt>
- </target>
- </project>
复制代码
[ 本帖最后由 小米啊 于 2010-6-18 19:06 编辑 ] |
|