从Python中提取测试类属性

2024-03-29 14:18:37 发布

您现在位置:Python中文网/ 问答频道 /正文

通过win32com从Python中,我从我的企业架构师项目中提取所有链接到ID=element\u ID的用例的测试用例:

test_cases = EA.GetElementSet("select * from t_objecttests where t_objecttests.Object_ID = %d "%element_id, 2);

通过在test_cases上循环,我想获得测试用例的属性。你知道吗

我按Test Class中的规定调用它们

获取属性没有问题:Notes、ObjectType、Status。你知道吗

通过调用其他属性,例如AcceptanceCriteria和Class,我得到一个AttributeError。你知道吗

如何得到它们?你知道吗


Tags: 项目testid属性链接测试用例element用例
1条回答
网友
1楼 · 发布于 2024-03-29 14:18:37

您需要从对象中检索相应的测试对象,如以下伪代码所示:

elem = repository.getElementById(<your test element id>)
test = elem.test.getAt(0)
print test.AcceptanceCriteria

相关问题 更多 >