11-23-2007 10:51 AM
I’m looking for a way to dynamically delete all Breakpoints and Watch Expressions in TestStand. Can you suggest a method to do. We are using ver 3.1 but will soon upgrade to 4.0.
11-26-2007 01:08 AM
11-26-2007 09:02 AM
John -
For watch expressions, you can use Engine.GetWatchExpressions and then clear the list. There is no easy programatic way to delete beakpoints. You would have to open each file that you think has breakpoints and iterate through each sequence and step and use Sequence.SetBreakOnEndSettings and Step.SetBreakSettings.
Another option that I think will work is if you are using a workspace, you can unload the workspace, clear Engine.PersistBreakpoints and Engine.PersistWatchExpressions properties, reload the workspace, and reset the properties.
I have made a suggestion to add better breakpoint access to the API for the future.
11-26-2007 09:02 AM
John,
Try this in TestStand 4.0 using the TS API Watch Expressions Class method: WatchExpressions.Clear or WatchExpressions.Remove.
Don't know the best/right way to call them, as I've not used them.
For breakpoints, I didn't see a potential way to delete breakpoints, but there is a way to disable them. Try StationOptions Class Set: StationOptions.BreakpointsEnabled set to False.
You could also try playing with the Engine Class Engine.PersistWatchExpressions and Engine.PersistBreakpoints to see if you can get them to go away when you want them too (i.e.; when shutting down they won't be saved, so they shouldn't be there when you start up the next time...).
Hope this helps.
-Jack
11-26-2007 09:28 AM
Hi Jack,
Interesting, the ApiPoster seems to be missing those methods from the WatchExpression class.
(Unfortunately I dont have TS4.0 to hand at the moment)
Regards
Ray
11-26-2007 03:41 PM
Hi,
The WatchExpressions wont clear your breakpoints.
To do this you have to get a reference to each step and use Step.SetBreakSettings(false,false,0, "") to clear the breakpoint. You can use Step.GetBreakSettings(Locals.IsSet,.....) and then use return value in IsSet to reset the breakpoint of the step.
Hope this helps
Regards
Ray Farmer