05-22-2013 08:50 AM
Hi everyone,
In my test setup I use a Thread and I want to store an object ref to that Thread in a variable (type: object reference).
In the sequence call settings I can provide a variable where I want to store this.
I've done this before and it all worked fine. When I stop the thread I'm able to use a wait step that waits for the thead to stop by providing the reference I stored when the thread was started.
Now I want to store the reference in a variable that is based on another variable. In my situation the following construction works. This is way I've entered in the Sequence call settings:
#NoValidation = True, Evaluate("FileGlobals.ModuleConfig." + Parameters.ModuleInstance + ".ThreadRef")
As you can see Parameters.ModuleInstance determines in which container the thread ref should be stored. But since this parameter is empty by default the evaluation fails so I have to use #NoValidation.
This seems a bit ugly to me so I also tried:
FileGlobals.ModuleConfig.GetPropertyObject(Parameters.ModuleInstance + ".ThreadRef")
According to teststand this construction is OK, however my thread ref is not stored in this case...
Is the first option I mentioned the only possible way for my problem? Or are there other, more elegant ways?
05-28-2013 12:22 PM
Hi Kayr,
I agree that the second approach you mention is the more elegant way to accomplish this. I was able to successfully use this method on my end to access a propertyObject. Can you send a sample sequence file so I can take a look?