首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Testlink中批量更新测试用例结果

如何在Testlink中批量更新测试用例结果
EN

Stack Overflow用户
提问于 2015-04-16 13:16:24
回答 3查看 2.8K关注 0票数 0

我最近开始在我的项目中使用testlink测试管理工具,我面临着一个新的问题,那就是在testlink中批量更新测试用例。

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

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

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

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

EN

回答 3

Stack Overflow用户

发布于 2015-04-21 19:40:17

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

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

代码语言:javascript
复制
select * from executions;

你好,大卫。

票数 0
EN

Stack Overflow用户

发布于 2015-05-18 03:55:51

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

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

票数 0
EN

Stack Overflow用户

发布于 2015-06-19 16:23:03

iam还使用Selenium webdriver更新测试链接

代码如下:

公共类appFunctions扩展了关键字{ //在此处替换您的开发密钥

代码语言:javascript
复制
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");
    }

}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29665860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档