03-31-2017 03:46 PM
Yes, yes - I remember, that SequenceContext is different in PreUUT, MainSequence, etc. - it was just an example...
Interesting, whether the same trick can be done for FileGlobals. It's possible to get reference to them by SequenceContext - but this reference should not be chaning in time of seq. execution; b/c just data what you can access via it can be changed...
I need to try this one also... Or, even get this reference value not via SequenceContext, but from TS via expression; and then store reference in LV FGV.
But I guess, that this will not work also...
03-31-2017 03:56 PM
Just quick update - luckily, FileGlobals reference is working inside of FGV! It's better then nothing 😃
04-01-2017 10:24 AM
So, finally, there is one workaround.
One can store in FGV reference to FileGlobals variables.
From TS, we store to FileGlobals variable value of ThisContext.
In FGV, we read that variable, convert to SequenceContext, and retreive currently executing step name, like this:
But, of course, it means, that when execution is inside of subsequence, we need to re-write value of FileGlobal variable to ThisContext of subsequence; and when we go back to main sequence, re-assign value back.
But this is solvable also! Just in SequenceFilePreStep callback of the sequence, we need to assign the following expression:
FileGlobals.Ref = RunState.Caller
where FileGlobals.Ref - is variable, where we store ThisContext reference.
Then, reference value will be updated all the time.
Time benchmark shows, that reading of variable and getting step name takes up to 2 ms - it's possible to live with it...