0

我最近开始在我的项目中使用 testlink 测试管理工具,并且在 testlink 中批量更新测试用例时遇到了一个新问题。

这对于手动测试用例来说不是问题,但对于自动化来说,更新您执行的每个测试用例的结果(通过或失败)是很乏味的。我有大约 5000 多个测试用例,其中 50% 是自动化的,所以当自动化时。

因此,当自动化脚本完成对特定版本的 2500 多个测试用例执行后,我需要在 testlink 中手动更新所有这些测试用例的结果为通过或失败。

我还尝试将自动化工具与 testlink 链接,但没有成功。

所以,我只想知道是否有任何简单的方法可以批量更新 testlink 中的测试用例。可能正在使用一些数据库查询和所有?

4

3 回答 3

0

我认为这很困难,因为您应该知道几个数据才能为您的项目、测试计划、构建、测试套件、测试用例和测试用例版本插入正确的信息。因此,您将需要所有这些信息。

无论如何,插入信息的表是“执行”,您可以使用以下查询检查所需的信息:

select * from executions;

问候,大卫。

于 2015-04-21T11:40:16.783 回答
0

1) 可以使用 XML-RPC API 2) 生成带有格式的 XML 文件用于导入结果,然后手动上传

避免通过 SQL 直接访问数据库

于 2015-05-17T19:55:51.053 回答
0

我还使用 Selenium webdriver 更新了测试链接

代码如下: -

public class appFunctions extends Keywords { // 在此处替换您的开发密钥

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

}
于 2015-06-19T08:23:02.743 回答