Absent Member.. Marco Neureuthe Absent Member..
Absent Member..
482 views

fill user defined field for all test instances in a test set

Jump to solution

Hello,

 

i am using QC12 and need one function. I tried to manage it by myself, but I didn´t solve it till now.

 

I am in the Test Lab module and have opened a Test Set. I  have to fill a user defined field in all test instances of this test set. All Test instances will be filled with the same value.

0 Likes
1 Solution

Accepted Solutions
Knowledge Partner
Knowledge Partner

Re: fill user defined field for all test instances in a test set

Jump to solution

Sure, you can set field values when iterating. For example:

 

aTSTest.Field("TC_USER_01") = "A value"
aTSTest.Post

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

0 Likes
5 Replies
Absent Member.. Trudy Claspill Absent Member..
Absent Member..

Re: fill user defined field for all test instances in a test set

Jump to solution
Is this a one time need to fill a field in existing test instances, or an ongoing need to fill the field automatically when new test instances are added?

You could create a new toolbar button in the test lab and code a custom workflow routine to retrieve a specified test set, retrieve all the test instances in that test set, and then step through those test instances updating the field. You would need to use the OTA API functionality.
[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
0 Likes
Highlighted
Absent Member.. Marco Neureuthe Absent Member..
Absent Member..

Re: fill user defined field for all test instances in a test set

Jump to solution

Hello,

 

These were the two options I also found. The following code does not do anything:

 

Function TestSet_CanAddTests(Tests)   'On Error Resume Next           

    TestSetTest_Fields.Field("TC_USER_01").Value = "myvalue"

    'TestSet_CanAddTests = DefaultRes  

    'On Error GoTo 0

End Function

 

 

I also wrote a own action and linked it to a button. This code works:

TestSetTest_Fields.Field("TC_USER_01").Value = "myvalue"

 

This is the same code like above.

 

Finally: it is OK that this value is set when I add tests to a test set. (As solution for now)

 

Thank you for further help!

0 Likes
Absent Member.. Marco Neureuthe Absent Member..
Absent Member..

Re: fill user defined field for all test instances in a test set

Jump to solution

Hello,

 

the TestSet_CanAddTests Function will not work because this Function is executed BEFORE a test Instance is created.

You cannot set a field value before the item ist created.

 

Does anyone have an idea?

0 Likes
Absent Member.. Marco Neureuthe Absent Member..
Absent Member..

Re: fill user defined field for all test instances in a test set

Jump to solution

Hello,

 

iterating through the test instances is clear. How to set a field value?

Is it possible to set field values?

0 Likes
Knowledge Partner
Knowledge Partner

Re: fill user defined field for all test instances in a test set

Jump to solution

Sure, you can set field values when iterating. For example:

 

aTSTest.Field("TC_USER_01") = "A value"
aTSTest.Post

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.