08-03-2012 08:34 AM
Hello,
Is it possible to set the checkbox "Specify by expression" in a statement ?
The statement should be in the cleanup.
If yes, what is the code line to write ? because this variable is not in
the variable window so I have no idea about how set this boolean.
Thanks
Solved! Go to Solution.
08-03-2012 08:52 AM
Sorry I did mistakes in my previous post
Is it possible to set the checkbox "Specify by expression" of a Sequence Call in a statement ?
The statement should be in the cleanup.
If yes, what is the code line to write ? because this variable is not in
the variable window so I have no idea about how set this boolean.
Maybe it is possible to call the sequence call like this:
RunState.Sequence.Main['Sequence Call"]...
but I didn't find how to access the boolean "Specify By Expression"
Thanks
08-08-2012 01:16 PM
Yes, you can set the Specify by Expression.
08-09-2012 02:33 AM
I know it lol.
But I want to set the checkbox at true or false in a separate statement, not directly in the sequence call.
Thanks
08-09-2012 09:52 AM - edited 08-09-2012 09:54 AM
You shouldn't do that if you can have multiple threads executing the same sequence at once because settings on steps are shared between all threads running them. You are effectively writing self-modifying code. You might consider having two sequence calls, one by expression and one not, and using a precondition to decide which to run.
If you want to change this setting programmatically you need to do something like the following:
step.Module.AsSequenceCallModule().SpecifyByExpression = true.
You are effectively editing the sequence file when you do this though, so I'd really recommend trying to solve the problem a different way. If you want help with that, please explain why you are wanting to change this setting at runtime and perhaps we can suggest a better way to solve the original problem.
-Doug
08-09-2012 10:13 AM - edited 08-09-2012 10:23 AM
I really need to have an expression like you write.
I need to do it in the cleanup because it is not really for a sequence call
but for a call_test (which are very similar to a sequence call, with exactly the same options),
which are create with a software specially create for my firm.
In my CALL_TEST I can't change anything, I can't add pre or post expression, post action, etc...
And the software has lots of bugs and sometimes the SpecifyByExpression are not true.
during the test it is normal but at the begining of the test it must be at true.
and because of the external software, this boolean is not at the right value.
So when I finish my test I need a step in the cleanup to give it the expected value.
My teststand don't find AsSequence in the auto completion after Step.Module 😞
So I have a evaluation error.
08-10-2012 12:57 PM
Where is the step you want to change the setting on in relation to the one that's changing the setting? Are the in the same sequence? Are they the same step?
-Doug
08-13-2012 02:26 AM
they are in the same sequence.
I need a statement in the cleanup to change the value of SpecifyByExpression which is in the main at the end of the tests.
08-13-2012 09:16 AM
An expression similar to the following should work:
RunState.Sequence.Main["myseqcall"].Module.AsSequenceCallModule.SpecifyByExpr = true
-Doug
08-16-2012 02:07 AM
Thanks for all Doug 🙂