NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to automate Find/Replace actions?

Solved!
Go to solution

Hi, dear ALL

 

TestStand has the utility "Find/Replace" (Edit menu). Is it possible to execute this tool via TestStand API? I want to select a set of steps in the sequence and pass the result to the "Find Results 1" tab..

 

Regards,

Max

0 Kudos
Message 1 of 6
(4,376 Views)

Is is possible to do a search programmatically (and make edits programmatically based on the results), however you cannot show the results in the Find Results window.

 

See the the online API documentation for more info:

PropertyObject.Search

Engine.SearchFiles

SearchResults

 

If you have an idea for improving Find/Replace functionality in TestStand, please consider posting it to the TestStand Idea exchange:

 

http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/idb-p/teststandideas

 

Hope this helps,

-Doug

Message 2 of 6
(4,347 Views)

Doug, many thanx for useful reference to API. The main problem doesn't concern with improving of Search utility... to be more detailed I develop a Tool  that examines every step in the current sequence and finds errors in expressions. As a result for now the Tool outputs a list of steps with errors to the execution output window. This result is acceptable, but not easy-to-use cause you have to move to the erroneous step manually.

 

It will be more comfortable to jump to the step as from "Search Results 1" window.. Object reference to the step is available. The problem is how to use this reference to jump to the specified step of a current sequence..

 

Could you suggest any idea?

 

Regards,

Max

0 Kudos
Message 3 of 6
(4,317 Views)
Solution
Accepted by topic author maksya

Two things to mention:

 

1) OutputMessages can have locations associated with them so that when you double-click on them, the sequence editor goes to the location. You can set the Location after creating the outputmessage with Engine.NewOutputMessage() (don't pass a sequence context in this case) and before Posting (i.e. before calling OutputMessage.Post()). The easiest way to add a location is by calling myOutputMessage.Locations.AddFileLocationByObject() and passing the reference you have to the step. See the API online help for more information.

 

2) I strongly recommend you take a look at TestStand 2010, there is currently a beta you can sign up for at:

 

http://forums.ni.com/t5/NI-TestStand/Announcing-the-TestStand-2010-Beta-Program/m-p/1136621

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 6
(4,304 Views)

Doug, thank you very much. Your link to "Locations" is very useful.

0 Kudos
Message 5 of 6
(4,261 Views)

Consider upgrading to TestStand 2010 which comes with a Sequence Analyzer that helps you find problems, such as expression errors, in sequences before you execute them.

0 Kudos
Message 6 of 6
(3,996 Views)