26671

TestLink XML-RPC The call to the xml-rpc client failed

Question:

I was trying to use the testLink(1.9.14 (Padawan)) xml-rpc in selenium JAVA(testNG) to sync the test result to testlink automatically. I provided the devkey and url what I used for the webdriverJS test.

public static String DEVKEY = "e69035750c91d1775900f4ce16dbcfb5"; public static String URL ="http://computername:80/testlink/lib/api/xmlrpc/v1/xmlrpc.php";

When I ran the test suite, I always got the error something like:

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 rocket.aldon.almwp.test.reportResult(test.java:19) at rocket.aldon.almwp.test.Test1(test.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) at org.testng.internal.Invoker.invokeMethod(Invoker.java:643) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:782) at org.testng.TestRunner.run(TestRunner.java:632) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244) at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) at org.testng.TestNG.run(TestNG.java:1064) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58) Caused by: org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse servers response: Expected methodResponse element, got br 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: 1; columnNumber: 7; Expected methodResponse element, got br at org.apache.xmlrpc.parser.XmlRpcResponseParser.startElement(XmlRpcResponseParser.java:98) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 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

Seems like the XML-RPC connection not works here, from the debug info, I could see the api object has isConnected = false; Could someone had met this and got a solution for it? The jars I am using:

testlink-api-client-2.0.jar selenium-java-2.52.0.zip selenium-server-standalone-2.52.0.jar xmlrpc-common-3.1-sources.jar xmlrpc-common-3.1.jar xmlrpc-client-3.1-sources.jar xmlrpc-client-3.1.jar commons-logging-1.1.jar guice-3.0.jar velocity-dep-1.4.jar ws-commons-util.1.0.2.jar

Can someone help to research? I google for a long time still not get clear way.

Answer1:

<blockquote>

I have following configuration which is working fine.

</blockquote>

<strong>Precondition :</strong>

<ul><li>Automation API should be enable </li> <li>Test Project, Test Plan, Build and test case should be created.</li> <li>Manual Pass/Fail should be work </li> </ul>

Please <strong>do below changes</strong> and <strong>restart Apache service</strong> :

<ol><li>

Do change as per given below lines in <strong>config.inc.php</strong> in <strong>Testlink folder</strong> :

$tlCfg->exec_cfg->enable_test_automation = ENABLED;

$tlCfg->api->enabled = TRUE;

</li> <li>

In C:\xampp\htdocs\testlink-1.9.15\lib\api\xmlrpc\v1 folder edit this file <strong>xmlrpc.php</strong> as under:

require_once("xmlrpc.class.php");

define('XMLRPC_REQUEST', true);

// Some browser-embedded clients send cookies. We don't want them. $_COOKIE = array();

$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");

$XMLRPCServer = new TestlinkXMLRPCServer();

</li> </ol>

Note : Just replace above lines If there is any other configurations are available. Do not edit anything else.

<ol start="3"><li>

After restart Apache service, Open Testlink and <strong>Open Test Project</strong> and enable Test Automation (API keys) in Project Management

</li> <li>

Take <strong>API key from User Setting</strong> and use it as DEV_KEY

</li> </ol>

Please let me know if any query.

Recommend

  • TestLink XML-RPC The call to the xml-rpc client failed
  • TestNG pass test parameter between different test class
  • Choose title- and file name at runtime
  • TestWatcher and TestNG
  • testng.xml not executing classes one by one
  • Framework for JMeter
  • Problem Installing older TestNG plugin on Eclipse 3.5
  • How to run TestNG tests in parallel using Eclipse?
  • how to run two selenium java files on after the other continuously when they dont have any relation
  • org.testng.TestNGException: while trying to execute the tests
  • Use Tomcat Library in Webapp project
  • not able to execute second Class from Testng.xml file
  • Debug TestNg java code in eclipse that uses Ant
  • How can I run Selenium 2 Grid from an Ant build?
  • ExtentReports: HtmlReporter not starting when running an executable jar file created using maven-ass
  • Selenium Grid throws Parameter 'selenium.host' is required by @Configuration on method sta
  • How to create multiple log files of different content with log4j
  • Unable to launch Chrome browser through Selenium in Jenkins on Linux platform
  • Unable to perform HTML5 drag and drop using javascript for Selenium WebDriver test
  • Is there a way to define the runorder of two different Testng Listeners?
  • An internal error occurred during launching testng in eclipse
  • How to make TestNG to add parameters to testng-customsuite.xml?
  • TestNG test not getting invoked
  • How to connect phantomjs to selenium using java
  • Default run configuration per TestNG group in IntelliJ IDEA
  • JNI error has occurred. Please check your installation
  • ITestListener - ExtentReport
  • Spark java.lang.NoSuchMethodError From Janino and Commons-Compiler
  • Where to find 5.x Testng eclipse plugin
  • Gradle TestNG Task is not create test-output folder
  • Can we build an application using selenium webdriver?
  • How can I set default reporters for TestNg from Intellij?
  • Run as TestNG Suite not working in eclipse
  • Configuring an Access report to use a SQL Server stored procedure as its record source
  • Gerrit will not push. Error: No common ancestry
  • Showing spinner for Rails 3 UJS gets Type error
  • Can my app be notified when another application starts/stops playing audio?
  • SignalR .NET Client Invoke throws an exception
  • Azure Cloud Service Web Role web pages do not load
  • coudnt use logback because of log4j