SystemLink Forum

Showing results for 
Search instead for 
Did you mean: 

Get URL link to test results posted from teststand

Go to solution

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?

0 Kudos
Message 1 of 6

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.

0 Kudos
Message 2 of 6

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.

National Instruments
Message 3 of 6

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



0 Kudos
Message 4 of 6
Accepted by jdkdev

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.

National Instruments
0 Kudos
Message 5 of 6

Thanks for the solution D_Biel!

0 Kudos
Message 6 of 6