我正在尝试将硒与Testlink测试管理工具集成在一起,我已经使用wampserver在本地计算机中成功安装了testlink。请参考我在以下google docs链接中编写的硒脚本:https://docs.google.com/document/d/1jyUBqJ9cx5496GiCTC5ktuXSXAYfhHmr7HLr6liTpbQ/edit

当我使用Testng运行脚本时,出现以下异常:

[Fatal Error] :3:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
[Fatal Error] :3:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
[Fatal Error] :3:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
[Fatal Error] :3:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
FAILED: f
testlink.api.java.client.TestLinkAPIException: The call to the xml-rpc client failed.
    at testlink.api.java.client.TestLinkAPIClient.executeXmlRpcMethod(TestLinkAPIClient.java:1266)
    at testlink.api.java.client.TestLinkAPIClient.execXmlRpcMethodWithCache(TestLinkAPIClient.java:1195)
    at testlink.api.java.client.TestLinkAPIClient.getProjects(TestLinkAPIClient.java:726)
    at testlink.api.java.client.TestLinkAPIHelper.getProjectInfo(TestLinkAPIHelper.java:64)
    at testlink.api.java.client.TestLinkAPIHelper.getProjectID(TestLinkAPIHelper.java:48)
    at testlink.api.java.client.TestLinkAPIClient.reportTestCaseResult(TestLinkAPIClient.java:184)
    at Pack3.ResultTestlink.reportTestCaseResult1(ResultTestlink.java:11)
    at Pack3.TestlinkExcecution.f(TestlinkExcecution.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:128)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1203)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
    at org.testng.TestNG.run(TestNG.java:1036)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse servers response: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:177)
    at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
    at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
    at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)
    at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
    at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
    at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:157)
    at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:146)
    at testlink.api.java.client.TestLinkAPIClient.executeXmlRpcMethod(TestLinkAPIClient.java:1232)
    ... 31 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)
    ... 39 more


请让我知道我在这里做错了。

最佳答案

通过编辑位于TestLink根文件夹中的config.inc启用XML-RPC

$tlCfg->api->enabled = TRUE;
$g_attachments->order_by = " ORDER BY id ASC ";

关于selenium-webdriver - reportTestCaseResult()提供teSTLink.api.java.client.TestLinkAPIException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15135345/

10-09 15:02