java如何串連testlink

來源:互聯網
上載者:User

標籤:

1.下載相關的jar包

 

2.擷取到testlink的url和key,注意:url不是testlink的串連地址,是串連地址+/lib/api/xmlrpc.php

3.測試是否串連成功

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());}

  運行後,出現hello即表明串連成功

 

4. 更改測試案例執行結果

//擷取測試計劃id
Integer testPlanId = api.getTestPlanByName("新增還款方式(最新)", "交易系統").getId();
String buildName = "交易新增還款方式";

Integer testCaseId = 3734;

api.reportTCResult(testCaseId, null, testPlanId, ExecutionStatus.FAILED, null, buildName, "自動化上傳結果的備忘", null, null, null, null, null, null);

  相關的用例id和buildname可以從匯出的測試計劃xml檔案中得到。如

 

附錄:

testlink常用的方法:http://testlinkjavaapi.sourceforge.net/implemented_methods.html

testlink介面:http://testlinkjavaapi.sourceforge.net/structure.html

 

java如何串連testlink

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.