Question

I'm looking into a solution where i have to write TestStand Tests' results to a database through a predefined API that can be accessed in the tests' sequence. Currently the way the test results are written to a database is through ODBC and by explicitly writing SQL statements into TestStand. I want, instead to write an application say in .Net and encapsulate those SQL statements calls within it.

Is this doable at all ? Can I write the application, build the DLL, load it into TestStand and through a .Net Adpater make it available to the Tests' sequence.

To make even the process worse, the actuall .Net application will consume webservice that will do the actual writing to the database.

This is my first experience with TestStand and i'm not sure I'm on the right track. Most of the docs i sifted through don't seem to hint to externalizing database interaction through a third party object (.Net, Active X or any DLL).

Would appreciate your comments on this

Thank you ken.

Was it helpful?

Solution

As long as your .NET application/library is fully functional (can write to the database and all that), you can absolutely call your .NET assembly using the .NET module adapter from TestStand. Shouldn't be a problem.

One thing I would recommend: Where you put the .NET step will depend on whether you want the database interaction to happen for just a particular device that's being tested (i.e., from one sequence), or you want the database interaction to occur for multiple types of devices that are being tested (i.e., multiple sequences / sequence files).

If it is the first case, you'd want the .NET database steps in your client sequence file. If it is the latter (want the database interaction for any sequence that runs), you'll probably want to put your database interaction code in the process model rather than in each individual client sequence file.

OTHER TIPS

Expanding on @J.J's answer:

If you want to log step results, I'd recommend using callbacks [Edit>>Sequence File Callbacks] where you would place steps which call your service.

If you only want to log data for a particular sequence file, place your logging code in SequenceFilePostResultListEntry.

If you want to log step results from all sequences you'll need to create your own custom process model (or modify one of the standard ones) and use ProcessModelPostResultListEntry.

In both cases, this will ensure that your logging code is called for every step that is marked with RecordResult = True. Step results are passed as parameters into the callback sequences. However, also make sure you check ThisContext.CallerDiscardsResults in the callback to see whether any parent SequenceCall steps have disabled result recording.

Personally, I think the Process Model approach is the best way to go since it gives more flexibility (and other callbacks to log the overall sequence result).

Note that there are other kinds of callbacks (PreStep, PostStep, PostStepRunTimeError etc) that you can use to log data in other scenarios than step results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top