Tapestry 5.2.4 和 Tapestry 的问题硒测试
从今天早上开始,我的硒测试出现了一些问题。
我创建了一个 Selenium 测试类:
public class IEPatchSeleniumTest extends SeleniumTestCase{
@Test
public void testTypingXSSCode() {
open("/Index");
}
}
我像这样配置了我的 testng.xml :
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Kawwa Tests" verbose="1">
<test name="Integration Tests" enabled="true">
<parameter name="tapestry.web-app-folder" value="src/test/app0"/>
<packages>
<package name="net.mm.tapestry.security.integration" />
</packages>
</test>
</suite>
我的 Maven-surefire-plugin 声明看起来像:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>-Xmx500m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
但是当我运行我的测试套件时,我遇到了 2 个错误:
<test-method status="FAIL" signature="testStartup(org.testng.ITestContext, org.testng.xml.XmlTest)" name="testStartup" is-config="true" duration-ms="0" depends-on-groups="beforeStartup" started-at="2011-02-04T13:46:02Z" finished-at="2011-02-04T13:46:02Z">
<exception class="org.testng.TestNGException">
<message>
<![CDATA[
Method testStartup requires 2 parameters but 0 were supplied in the @Configuration annotation.]]>
</message>
<full-stacktrace>
<![CDATA[org.testng.TestNGException:
Method testStartup requires 2 parameters but 0 were supplied in the @Configuration annotation.
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:147)
at org.testng.internal.Parameters.createParameters(Parameters.java:96)
at org.testng.internal.Parameters.createParameters(Parameters.java:289)
at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:70)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:135)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
at org.testng.TestRunner.beforeRun(TestRunner.java:501)
at org.testng.TestRunner.run(TestRunner.java:469)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:198)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
at org.testng.TestNG.run(TestNG.java:708)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
]]>
</full-stacktrace>
</exception>
</test-method>
<test-method status="FAIL" signature="indicateTestMethodName(java.lang.reflect.Method)" name="indicateTestMethodName" is-config="true" duration-ms="0" started-at="2011-02-04T13:46:02Z" finished-at="2011-02-04T13:46:02Z">
<params>
<value>
<![CDATA[public void net.mm.tapestry.security.integration.IEPatchSeleniumTest.testTypingXSSCode()]]>
</value>
</params>
<exception class="java.lang.NullPointerException">
<full-stacktrace>
<![CDATA[java.lang.NullPointerException
at org.apache.tapestry5.test.SeleniumTestCase.indicateTestMethodName(SeleniumTestCase.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:427)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
at org.testng.TestRunner.runWorkers(TestRunner.java:712)
at org.testng.TestRunner.privateRun(TestRunner.java:582)
at org.testng.TestRunner.run(TestRunner.java:477)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:198)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
at org.testng.TestNG.run(TestNG.java:708)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
]]>
</full-stacktrace>
</exception>
</test-method>
以前有人遇到过这些问题吗?您选择了哪种解决方案?
多谢。
I am some problems since this morning with my Selenium Test.
I created a Selenium Test Class :
public class IEPatchSeleniumTest extends SeleniumTestCase{
@Test
public void testTypingXSSCode() {
open("/Index");
}
}
I configured my testng.xml like that :
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Kawwa Tests" verbose="1">
<test name="Integration Tests" enabled="true">
<parameter name="tapestry.web-app-folder" value="src/test/app0"/>
<packages>
<package name="net.mm.tapestry.security.integration" />
</packages>
</test>
</suite>
And my Maven-surefire-plugin declaration looks like :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>-Xmx500m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
But when I ran my tests suite, i have got 2 errors :
<test-method status="FAIL" signature="testStartup(org.testng.ITestContext, org.testng.xml.XmlTest)" name="testStartup" is-config="true" duration-ms="0" depends-on-groups="beforeStartup" started-at="2011-02-04T13:46:02Z" finished-at="2011-02-04T13:46:02Z">
<exception class="org.testng.TestNGException">
<message>
<![CDATA[
Method testStartup requires 2 parameters but 0 were supplied in the @Configuration annotation.]]>
</message>
<full-stacktrace>
<![CDATA[org.testng.TestNGException:
Method testStartup requires 2 parameters but 0 were supplied in the @Configuration annotation.
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:147)
at org.testng.internal.Parameters.createParameters(Parameters.java:96)
at org.testng.internal.Parameters.createParameters(Parameters.java:289)
at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:70)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:135)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
at org.testng.TestRunner.beforeRun(TestRunner.java:501)
at org.testng.TestRunner.run(TestRunner.java:469)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:198)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
at org.testng.TestNG.run(TestNG.java:708)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
]]>
</full-stacktrace>
</exception>
</test-method>
<test-method status="FAIL" signature="indicateTestMethodName(java.lang.reflect.Method)" name="indicateTestMethodName" is-config="true" duration-ms="0" started-at="2011-02-04T13:46:02Z" finished-at="2011-02-04T13:46:02Z">
<params>
<value>
<![CDATA[public void net.mm.tapestry.security.integration.IEPatchSeleniumTest.testTypingXSSCode()]]>
</value>
</params>
<exception class="java.lang.NullPointerException">
<full-stacktrace>
<![CDATA[java.lang.NullPointerException
at org.apache.tapestry5.test.SeleniumTestCase.indicateTestMethodName(SeleniumTestCase.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:427)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
at org.testng.TestRunner.runWorkers(TestRunner.java:712)
at org.testng.TestRunner.privateRun(TestRunner.java:582)
at org.testng.TestRunner.run(TestRunner.java:477)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:198)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
at org.testng.TestNG.run(TestNG.java:708)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
]]>
</full-stacktrace>
</exception>
</test-method>
Anyone had these problems before? Which solution did you choose ?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 pom.xml 中设置的 TestNG 版本。 :)
Check the version of TestNG that is being set in your pom.xml. :)