I have some code I would like to run, only if the current report level is Debug.
I can use the current test suite debug level in the TestSuite.Current.ReportLevel, but since each container or test case can have a level other than Inherit, I need to know the actual report level of the test container.
While debugging, I can see the local variable of ReportLevel for the TestSuite.Current.CurrentTestContainer, but I cannot actually use it in code
What would be the proper way to tell what the current report level was?
Getting CurrentTestContainer ReportLevel
Re: Getting CurrentTestContainer ReportLevel
What do you mean by, "I cannot actually use it in code"?
If it's "Inherit" can you recurse up the ParentContainer hierarchy until you find the report level it's inheriting?
If it's "Inherit" can you recurse up the ParentContainer hierarchy until you find the report level it's inheriting?
Re: Getting CurrentTestContainer ReportLevel
When I say that I cannot use it in code, I can see it while debugging, but don't know how to actually USE it in my user code logic.
Forgive me if it is simple code, I am not a programmer, just a tester who was thrown deep into user code.
I just basically need this
But of course, that doesn't actually work.
Forgive me if it is simple code, I am not a programmer, just a tester who was thrown deep into user code.
I just basically need this
Code: Select all
if (ReportLevel == Debug)
{
do this;
}
Re: Getting CurrentTestContainer ReportLevel
I still don't really understand what you're asking for I'm afraid.
You could write a code module that acquires the current Test Container report level and assigns that to a Parameter on the Test Case. You could then put conditions onto your Smart Folders such that they only execute if this previously acquired report level is such-and-such, thus controlling which modules or recordings run.
But I really don't know if that's what you're trying to do.
You could write a code module that acquires the current Test Container report level and assigns that to a Parameter on the Test Case. You could then put conditions onto your Smart Folders such that they only execute if this previously acquired report level is such-and-such, thus controlling which modules or recordings run.
But I really don't know if that's what you're trying to do.