08-13-2012 03:47 AM
I'm trying to find out how to change the step name.
The problem is: When I call a sequence several times, I can find the names of the steps in the report for about 50 times.
So, what I want to do is: I want to pass a prefix for the step name on calling the sequence and add this prefix to each step name.
Do you have an idea how to do that?
Thanks a lot
Solved! Go to Solution.
08-13-2012 07:10 AM
Thanks for your help!
It helps so far that now I can change the name. Very good :-). I wouldn't have found it myself.
But now, with evey call, the name becomes longer and longer ;-) (without the post-expression). And somehow the program seems to evaluate the post-expression before saving the name in the report. So I can choose between a super long name and the default name.
Here is what i wrote:
Step.Name = Parameters.sCallerSequence+Step.Name
Post-Expressiontep.Name = Right(Step.Name,Locals.iStepNameLength)
08-13-2012 07:51 AM
Try to make it static.
Do not use Step.Name on the right side, use a local instead.
Step.Name = Parameters.sCallerSequence+Local.strName
If this will not help there is an other way to rename StepNames in report, by renaming it the ResultList.
but you need an additional step!!
08-13-2012 08:30 AM
I had hoped that the solution would be easier :-(.
Thank you very much for your help. I learnd a lot!
Since my sequences are about 60 steps each (at the moment I have about 30 and it will be more), it's not so nice to save the step names in local variables. But it's also a lot of work to add additional test steps to change the names in the report.
Maybe I have to think about another way to get the structure clear in the report
08-13-2012 04:09 PM
Be careful with dynamically changing the name of the step at runtime -- it can cause interesting things to happen if you are not careful.
Consider adding information to Step.ReportText to add clarification of what is actually happening.
Also, you probably want to avoid using the expression Step.Name, as it is not necessairly the name of the step (especailly if you use this on a custom step type that has a variable you added called Step.Name) use instead NameOf(Step) or Step.AsPropertyObject.Name to help make sure you get the name of the step.
08-15-2012 01:46 AM
Thank you for the hint. Seems to be a good alternative to changing the step name.
Where can I add information to Step.ReportText? This variable does not seem to exist...(I tried to pass a value in the Post-Expressions field).
08-21-2012 06:44 AM
You're right, this returns a text in the protocol. Thank you!
Unfortunately it is hidden somewhere in the report when the teststep is passed (I use the xml-report with stylesheet "expand.xml").
I suppose I have to learn to create my own stylesheet or report model or whatever.