lundi 14 novembre 2016

TestLink integration for test automation (Java, XML-RPC, Eclipse)

I am currently writting Java Program to execute tests and push the results on a testlink. I am using TestLink 1.9.14 and following site like : http://ift.tt/2eXxRs8.

So I would like to do :

TestLinkAPIClient apiClient = new       TestLinkAPIClient(ACCESS_KEY,TESTLINK_SERVER_URL);
apiClient.reportTestCaseResult(TESTLINK_PROJECT_NAME, TESTLINK_TESTPLAN_NAME,testCaseID, BUILD_RELEASE_NAME, executionNotes, result);

With theses packages :

  • testlink-api-client-2.0.jar
  • commons-logging-1.1.jar
  • junit.jar
  • ws-commons-util-1.0.2.jar
  • xmlrpc-client-3.1.jar
  • xmlrpc-client-3.1-sources.jar
  • xmlrpc-common-3.1.jar
  • xmlrpc-common-3.1-sources.jar

TestLink seems to be not really available (API for exemple, so I tried already 3 different version of the API).

I google for a long time and tried something. So I tried to modify the xml-rpc file in the TestLink folder, I tried different .JAR and another version of TestLink (1.9.12). For the moment, I get this message :

Exception in thread "main" 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.ping(TestLinkAPIClient.java:158)
    at com.selenium.integration.Program.main(Program.java:29)
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)
    ... 3 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)
    ... 11 more

Do you have some ideas?

thanks, have a nice coding day :p

Aucun commentaire:

Enregistrer un commentaire