07-12-2022 10:07 AM
Hi There,
I am running some tests from teststand and using the systemlink plugin to post the result to the systemlink database. In addition, we also update test results in our 3rd party requirements database and what I would like to do is get a URL or link to the results that we posted to systemlink. Is there a way to get the URL of the results we just sent from teststand to systemlink?
Solved! Go to Solution.
07-12-2022 05:07 PM
The URL for the results is pretty simple.
https://<server>/#testmonitor/testresults/testresult/<test result ID>
What I'm not sure about is how to get the test result ID from the TestStand execution model for the SL results processing plugin.
07-12-2022 05:58 PM - edited 07-12-2022 05:59 PM
Hi jdkdev,
The result ID is a bit hidden in TestStand, but you can get to it from your sequence.
In the UUTDone callback, you can access RunState.Root.Locals.ModelPluginConfiguration.Plugins[Index].PluginSpecific.RuntimeVariables.PerSocket[socketIndex].CurrentRunId. To get the plugin index, you can loop through the ModelPluginConfiguration.Plugins[] to find one with Plugins[i].Base.SequenceFileName == "NI_TestMonitorClient.seq".
I will caveat that this is an internal field that isn't designed to be used by end users. It's possible this could change in a future release, although unlikely.
07-12-2022 11:28 PM
Hi D_Biel,
I was able to get the CurrentRunId, however it does not match the url of the result in system link. Have you used this feature before, or any other ideas on how to get the correct ID from the end of the URL. This is what our URL looks like https://<server>/#testmonitor/testresults/testresult/62ce416341289dd2e616e0d9
07-13-2022 10:37 AM
I mistakenly posted that you can get it in the UUTDone callback, which is incorrect and you can't even access from the test program. I meant to say PostUUT, which you seem to have figured out.
But I realize this approach will not work if the Store and Forward option is enabled in the Test Monitor result processing configuration. And there isn't a good solution for that case. Store and forward caches the messages to the server in a file and forward them onto the server as its available. It creates a temporary ID for the result to correlate the steps and updates to the result with. And the store and forward process later maps those to the real ID. But that real ID never makes it back to TestStand.
You could disable store and forward, but then your test program will error if it cannot communicate with the server and results will be lost.
The only other option would be to query the server for the result using the TestMonitor API. But you would need to write a custom code module for this since there is not a TestStand step for querying. Here is the documentation on the API if you are not familiar. The other issue is that in the latest version of SystemLink, the forwarding service only runs once a minute. So if you have a sequence that is faster than that, it could be stuck waiting for the result to be forwarded to the server.
07-21-2022 10:09 AM
Thanks for the solution D_Biel!