问题描述
我正在使用python与HP QC进行交互,并参考HP ALM OTA文档.我需要访问不同位置的字段(特别是现在我正在尝试访问测试集描述"字段).据我所知,它是通过以下操作完成的:TestSet['description field name'] = 'I am description'
问题是-我不知道该字段名称,也无法在提到的文档中找到它.
到目前为止,我一直在想希望找到这些名称的示例(我在测试步骤中发现实际"字段名为"ST_ACTUAL"的方式).
I am interacting with HP QC using python and referring to HP ALM OTA documentation.What I need is to access fields in different places (particularly now I am trying to access Test Set description field). As far as I know it is done by following: TestSet['description field name'] = 'I am description'
The problem is - I don't know this field name and I can't find it in documentation mentioned.
Up until now I was wondering around examples in hope to find these names (the way I found that Actual field in test step is named 'ST_ACTUAL').
您能帮我找到这些字段名称的某种列表吗?或检索它们的方式..(或至少给我这个测试集描述字段的名称)
Could you please help me find some kind of list of these field names. Or the way to retrieve them.. (Or at least give me the name of this Test Set description field)
推荐答案
获得实体字段值时,该字段必须是该实体的基础数据库列名称.您可以使用HP ALM中的项目自定义UI来发现此问题:选择项目实体,然后浏览系统或用户字段.请注意,设计步骤"指出列名称以ST_开头,但不是.实际上是DS _...
When you get an entity field value, the field must be the underlying database column name for that entity. You can discover this using the project customization UI in HP ALM: select project entities then explore the system or user fields. Beware that the Design Step says the column name begins ST_... it doesn't. It's actually DS_...
您还可以通过编程方式获取此信息.给定工厂实例,请使用以下等效项:
You can also get this information programmatically. Given a factory instance use the equivalent of:
private void ExploreFactoryFieldDefinitions(IBaseFactory factory)
{
List fields = factory.Fields;
foreach (TDField field in fields)
{
FieldProperty field_property = (FieldProperty)field.Property;
if (field_property.IsRequired)
{
Log(String.Format("User Label: {0}\n", field_property.UserLabel));
Log(String.Format("User Column Type: {0}\n", field_property.UserColumnType));
Log(String.Format("DB Column Name: {0}\n", field_property.DBColumnName));
Log(String.Format("DB Column Type: {0}\n", field_property.DBColumnType));
Log(String.Format("DB Table Name: {0}\n", field_property.DBTableName));
}
}
}
field_property.UserLabel为您提供用户友好的字段名称. field_property.DBColumn名称为您提供了应与实体[field_name]一起使用的数据库列名称.
field_property.UserLabel gives you the user friendly field name. field_property.DBColumn name gives you the database column name that should be used with entity[field_name].
顺便说一句-不要忘了打电话给entity.Post()保存您的更改.当使用版本化项目时,您也会遇到更多麻烦.祝你好运!
BTW - don't forget to call entity.Post() to have your changes saved. When working with a versioned project you have a few more hoops to jump through too. Good luck!
这篇关于HP Quality Center字段名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!