cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

testRunSuccess determination

rick_boyd
Mentor

Hi!

Trying to follow along at

https://community.dynatrace.com/community/pages/vi... but having an issue understanding when is appropriate to set the related javascript object sessionStorage.DT_TESTRUN_SUCCESS = true. It seems that in order to ensure the var is set while the test is being evaluated, this might have to be set *before* the action is actually executed, is that correct? It seems like we may need to run the actual test case, set DT_TESTRUN_SUCCESS = true, then do another arbitrary action just to push the result. Am I following that correctly?

Trying to tag Sonja here, but '@' tagging does not seem to be working for me...

Thanks,

Rick B

4 REPLIES 4

andreas_grabner
Dynatrace Guru
Dynatrace Guru

Hi Rick

Here are my thoughts

#1: if you do not set that variable at all we assume the test is successful

#2: I think you should set the variable AT THE END of your test run - which is when you know whether your functional test is successful or not based on your functoinal test criteria. If you set that env variable and then invoke the "dynatrace.endvisit()" function the success status will be sent and applied to that visit

makes sense?

has the functionality of dynatrace.endVisit() changed? it used to only change the dtcookie, meaning if you invoked dynatrace.endVisit() and then synced up with the app with another call to /dynaTraceMonitor, that any action that was still in queue to be sent would actually come in as part of a new visit. Also, because of the way that the variable is accessed (as an action attribute), i think it needs to be tied to a specific action, ergo set before an action is performed. Can someone clarify?

hi Rick - I think you understand it right. If you set sessionStorage.DT_TESTRUN_SUCCESS = true, you will need to perform one last action (e.g. navigate on another page) to make sure it is being sent to the server. Ending the visit will not be enough.

We are looking into alternatives (e.g. introducing JS ADK call to push the data), but that's the situation right now.

Keep us posted if this works for you!

Sonja

Thanks Sonja for correcting my false claim. Maybe sending that data as part of "endVisit" would be a good approach as it might not always be possible to create another user action after the script finished and the tool tells us the success status