04-23-2007 09:47 AM
04-24-2007 02:04 AM
Hi,
Trouble is you cannot use the Post Expression of the Step to modify ReportText because you dont know whether the step has passed or failed at this moment in time. You dont really what to added an extra step to modify the Previous Step.
What you could do, is use the SequenceFilePostResultListEntry sequence callback. When this sequence is called you will know the Step.Result.Status and therefore you can modify the contents of the Step.Result.ReportText as required. Trouble is this sequence will affect all steps, so unless you are using custom step types which have properties containing the pass or failed string. You will have to find some other way of getting the ReportText string into the sequence.
One possible way :-
If you pass the required text for both pass and failed text from your code module
eg Step.Result.ReportText = "Battery current OK|Battery current is to high"
In the SequenceFilePostResultListEntry sequence, the Step and Result properties for a Step are passed via the Parameters of SequenceFilePostResultListEntry.
ie In SequenceFilePostResultListEntry, Parameters.Step.Result.ReportText will equal "Battery current OK|Battery current is to high" and so will Parameters.Result.ReportText.
Therefore you can now change Parameters.Step.Result.ReportText and Parameters.Result.ReportText by stripping off the required text depending on the status of Parameters.Step.Result.Status or Parameters.Result.Status
eg
(Parameters.Result.Status == "Passed")
?
(Parameters.Result.ReportText = Left(Parameters.Result.ReportText, Find(Parameters.Result.ReportText, "|" ) ) )
:
(Parameters.Result.ReportText =Right(Parameters.Result.ReportText, Len(Parameters.Result.ReportText) - Find(Parameters.Result.ReportText, "|" ) - 1))
Then
Parameters.Step.Result.ReportText = Parameters.Result.ReportText
So the First part of the expression strips out either "Battery current OK" or "Battery current is to high" depending on whether Parameters.Result.Status is "Passed" and puts the value back into Parameters.Result.ReportText. When SequenceFilePostResultListEntry returns Parameters.Result is put into Locals.ResultList but the value of ReportText in the Step still contains the original string. Hence the final part of the expression above. This updated the Step.Result and therefore will contain the modified version.
Hope this is clear.
Regards
Ray Farmer