2015-04-16 76 views
0

我最近開始在我的項目中使用testlink測試管理工具,並且在測試用例的批量更新中遇到新問題。如何在Testlink中批量更新測試用例結果

這對手動測試用例來說不是問題,但對於自動化來說,更新執行的每個單個測試用例的結果(通過或失敗)是很繁瑣的。 我有大約5000+測試案例,其中50%是自動化的,所以當自動化。

因此,當自動化腳本完成時,爲特定發行版執行2500多個測試用例,我需要將testlink中所有這些測試用例的結果更新爲Pass或Fail。

我也嘗試鏈接自動化工具與testlink,但沒有解決。

所以,我只是想知道是否有任何簡單的方法批量更新testlink中的測試用例。可能會使用一些數據庫查詢和所有?

回答

0

我認爲這很困難,因爲您應該知道一些數據才能爲您的項目,測試計劃,構建,測試套件,測試用例和測試用例版本插入正確的信息。所以,你需要所有這些信息。

反正插入信息表是「處決」用下面的查詢可以查詢所需要的信息:

select * from executions; 

的問候,大衛。

0

1)你可以使用XML-RPC API 2)生成XML的文件格式導入結果,然後手動

避免使用到DB的直接訪問通過SQL

0

IAM還更新上傳使用Selenium測試鏈接webdriver的

的代碼如下: -

公共類appFunctions extends關鍵字{// 替換爲您開發這裏的關鍵

public static String DEV_KEY= "1eab09b6158d9df31e76142b85253243"; 

    public static String SERVER_URL = "https://testlink.fondsdepotbank.de/testlink/lib/api/xmlrpc/v1/xmlrpc.php"; 


public static void clearXLResults() throws IOException 
{ 
    try 
    { 
     int testStepsRow=DriverScript.xlObj.getRowCount("TestSteps"); 
     int controllerRow=DriverScript.xlObj.getRowCount("Controller"); 

     //Clear previous results 
     for(int i=2;i<=testStepsRow;i++) 
     { 
      DriverScript.xlObj.setCellData("TestSteps",DriverScript.testStepsStatusCol, i, ""); 
     } 
     for(int j=2;j<=controllerRow;j++) 
     { 
      DriverScript.xlObj.setCellData("Controller", DriverScript.controllerStatusCol, j, ""); 
     } 
    }catch(Exception e) 
    { 
     e.printStackTrace(); 
     log.writeLog("Unable to clear previous test results in excel"); 

    } 
} 


public static void updateResultsTestLink() throws IOException 
{ 
    try 
    { 
     TestLinkAPIClient api=new TestLinkAPIClient(DEV_KEY, SERVER_URL); 
     String result; 
     //read controller status 
     int controllerRow=DriverScript.xlObj.getRowCount("Controller"); 
     for(int k=2;k<=controllerRow;k++) 
     { 
      String currentRowStatus=DriverScript.xlObj.getCellData("Controller",DriverScript.controllerStatusCol,k); 
      String currentRowProject=DriverScript.xlObj.getCellData("Controller",DriverScript.controllerProjectCol,k); 
      String currentRowPlan=DriverScript.xlObj.getCellData("Controller",DriverScript.controllerPlanCol,k); 
      String currentRowBuild=DriverScript.xlObj.getCellData("Controller",DriverScript.controllerBuildCol,k); 
      String currentRowTCID=DriverScript.xlObj.getCellData("Controller",DriverScript.controllerTCIDCol,k); 
      if(currentRowStatus.equalsIgnoreCase("pass")) 
      { 
       result= TestLinkAPIResults.TEST_PASSED; 
       api.reportTestCaseResult(currentRowProject, currentRowPlan, currentRowTCID, currentRowBuild, null, result); 
      } 
      if(currentRowStatus.equalsIgnoreCase("fail")) 
      { 
       result= TestLinkAPIResults.TEST_FAILED; 
       api.reportTestCaseResult(currentRowProject, currentRowPlan, currentRowTCID, currentRowBuild, null, result); 
      } 
     } 

    }catch(Exception e) 
    { 
     e.printStackTrace(); 
     log.writeLog("Unable to update results in Testlink"); 
    } 

} 
相關問題