【问题标题】:Quality Centre, TestSetFactory [PYTHON]质量中心,TestSetFactory [PYTHON]
【发布时间】:2014-08-07 14:07:19
【问题描述】:

我在从 HP QC 转储测试集列表时遇到问题。我正在使用 TestSetFactory 对象和简单的 SQL 查询,我收到 > 对象(我很想收到字典填充的基本转储。这段代码有什么问题?如果您对实现某些功能有疑问,请写。

 def create(self):
        self._report_connector.connect()
        self.qc_test_set_factory = self._report_connector._get_factory(self._path)
        test_sets = self.qc_test_set_factory.NewList("SELECT * FROM CYCLE ")
        if test_sets == None:
            print " no results"
        for test in test_sets:
            pprint.pprint(test)    #<---- it print me <COMOBject <unknow>>
            print len(test_sets)   #<---- it print me 1

【问题讨论】:

  • 不清楚您在这里要做什么。 create 函数试图做什么 - 即:它在创建什么?另外,您期望列表的大小是多少,是 1 不正确吗?
  • 感谢您的关注! create 函数的任务是创建字典,其中包含来自质量中心数据库的记录。不可能,它们的长度是 1。基本上我想用 db 中的所有记录创建 XML。 _report_connector 是从 HP API 调度的 TDConnector,qc_test_set_factory 是 TestSetFactory(我想用它来拉伸数据库中的记录),而 test_sets 是字典,其结构类似于数据库的表。
  • 长度为 1 并非不可能。您通过打印 len(test_sets) 表明它是 1。type(test_sets) 的结果是什么?
  • type函数的结果是"
  • 问题已解决;)非常感谢您的帮助:)

标签: python hp-quality-center


【解决方案1】:

不确定其余代码的准确性,但您没有将 SQL 查询传递给 TestSetFactory.NewList 方法。如果您想要所有内容,请传递一个空字符串。

test_sets = self.qc_test_set_factory.NewList("")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-09
    • 2023-03-28
    • 2017-03-04
    相关资源
    最近更新 更多