Access the components of a business process test
I want to access the components belonging to a specific business process test via C# coding.
What I have for now is the following piece of code for a specified test (objTest):
// cast the test to a BusinessProcess-test
BusinessProcess objBPTest = (BusinessProcess)objTest;
// loop over each component attached to the business process test
foreach (BPComponent bpComponent in objBPTest.BPComponents)
// some other code, but never reached as objBPTest.BPComponents returns an empty list
The problem is that objBPTest.BPComponents always returns an empty list. Does anyone know what I am doing wrong?
Re: Access the components of a business process test
I just found the answer:
apparently you need to load the business process test before you can use it, so including next line of code after the casting makes it work: