How Java connects Testlink

Source: Internet
Author: User
Tags testlink

1. Download the relevant JAR package

2. Get to Testlink URL and key, note: URL is not testlink connection address, is the connection address +/lib/api/xmlrpc.php

3. Test if the connection is successful

public static void Main (string args[]) {        string url = "http://test.tl.gmsd.lan/lib/api/xmlrpc.php";        String Devkey = "223f929e98e3d74fa3c000b67668e305";        TESTLINKAPI API = NULL;                URL testlinkurl = null;                Try     {                testlinkurl = new URL (URL),        } catch (Malformedurlexception Mue)   {                Mue.printstacktrace ( SYSTEM.ERR);                System.exit ( -1);        }                API = new         try     {               API = new Testlinkapi (Testlinkurl, Devkey);        } catch (Exception te) {                Te.printstacktrace (System.err);                System.exit ( -1);        }                System.out.println (Api.ping ());}

After running, a hello appears to indicate a successful connection

4. Change test Case Execution Results

Get the test plan ID
Integer Testplanid = Api.gettestplanbyname ("New Repayment Method (latest)", "Trading System"). GetId ();
String buildname = "Transaction new repayment method";

Integer Testcaseid = 3734;

Api.reporttcresult (Testcaseid, NULL, Testplanid, executionstatus.failed, NULL, Buildname, "notes for automated upload results", NULL, NULL, NULL, NULL, NULL, or NULL);

The associated use case ID and buildname can be obtained from the exported test plan XML file. Such as

Appendix:

Testlink Common methods: http://testlinkjavaapi.sourceforge.net/implemented_methods.html

Testlink Interface: http://testlinkjavaapi.sourceforge.net/structure.html

How Java connects Testlink

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.