03-10-2025 11:35 AM
Hello Community,
I am using TestStand 2024 Q4 64-bit and a SQL Database.
In my database I have the following tables:
1. StepResult table with 3 fields called StepResultId, StepName, and StatusId
2. Status table with 2 fields called StatusId and StatusName
In TestStand the step.result.status property is a string value with the following options "Done", "Skipped", "Passed", "Failed", and "Error".
How can I update these values to be integers in TestStand for logging to the database?
Example:
Status Table StepResult Table
StatusId StatusName StepResultId StepName StatusId
1 Passed 1001 MyTestStep1 1
2 Failed 1002 MyTestStep2 1
3 Error 1003 MyTestStep3 2
4 Done
5 Skipped
Thank you!
03-11-2025 01:21 AM
IMHO, having the Status as a name has been one of the fundamental design decisions.
Trying to change something here might be challenging/ painful.
In theory, you could go and have your own typedefs, which feature an interger field in the respective result container, modify the StatusExpression to set values. I' not sure, if you have to modify the Database Schema to actually push this to the DB.
If you need this integer information for data evaluation, you might want to consider adding a "translation" table to your DB and use a JOIN for your SELECT to "replace" the string-based status with an interger based one.
Might be less painful and easier to mainain in the future.
03-11-2025 07:28 AM
I know it may be difficult, but I had to at least ask for my own curiosity. For a report it is nice to see "Passed" or "Failed", but when logging to a database it is more efficient to store an integer. My test could have many steps and recording "Passed" as a string for each record adds up in bytes. Is there a place I could add a select case to test if the result is passed, then use a statement to record the integer in a ResultList, and then somehow log the new ResultList?
03-11-2025 09:41 AM
In order to achieve this, you could overwrite the SequenceFilePostResultListEntry to add your custom data using the TestStand API
Yet, if you want to save data base storage, you need to exclude the standard string via custom schema.