Where do you find the attachments loaded by a tester in the guided test execution screen?

VJ20
Kilo Contributor

If a tester uses the guided execution and uploads an attachment, where can we see the attachment? It is not in the test plan.

I don't see it in Metric Results either.

1 ACCEPTED SOLUTION

ITSMgal
ServiceNow Employee
ServiceNow Employee

Hi Vanessa -



I was testing this a few weeks back and noticed the same thing you came across.


Through the Helsinki release, the attachments are not being copied over on submission or save of the test.



When i asked for a recommendation on how to access the attachments,   it was to use the record based view of test executions instead of the assessment/survey "Guided Test" method. This way the tester could attach to the correct record.



While this may work in some cases, it may not be the ideal solution.



The alternative is a code based (partial) solution for this issue. I used this in a demonstration, but its NOT PRODUCTION CODE 🙂



Here is the catch - this code copies the attachment to all of the test execution steps.


This can be good and bad -


Good: the attachment will be available from the step it failed


Bad: Irrelevant attachments will exist on execution steps.


This alludes to what Chuck Tomasi@   was saying re: the target record.



If we only copy the attachment to the test case, then its not as easily available on the execution step.


The challenge here is which record it should equate to in the test execution. There is currently only one "attachment" for the entire test execution, so when someone goes to view the execution step, where should the attachment really be?



It would be interesting to get your feedback on this. I would appreciate if you could open up a ticket with ServiceNow support on this issue to explain what the problem is. https://hi.service-now.com This will find its way to the Product Backlog through our Service Management process. Feel free to post the ticket number here so i can track it.



Regarding the code to copy the attachment:




We sync up test results from assessments to test plan through the SCRIPT INCLUDE tm_AssessmentResultSync.


In that there is a method syncResults



In that around line 26 you will find code like this



if( testCaseMetric.isValid() ) {


                              this.updateResult(testCase, testCaseMetric, asmtInstance);


GlideSysAttachment.copy(tm_TestManagement.ASMT_INSTANCE, asmtInstanceDecorator.getValue('sys_id'), tm_TestManagement.TEST_CASE_INSTANCE, testCase.getValue('sys_id'));


}



Add the line in Green there and it will copy attachments from assessment to test cases.



One thing to note, if testers takes test cases through assessment multiple times, attachments will get copied multiple times.


So may be you need to add a logic to delete attachments and copy again.



NOTE: Please do not add this directly in production. It was code used for demonstration purposes only. It needs fully tested against your use case.


View solution in original post

15 REPLIES 15

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Venessa,



What is "guided execution" referred here? I am assuming this is related to service catalog.


If yes then it should be in request table i.e sc_request.


Hi



I'm referring to guided test execution in Test Management.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Can you please share screenshot?


VJ20
Kilo Contributor

The tester adds attachment in My Tests, but only they can see this screen.


find_real_file.png


The test manager would go to the test plan, but there are no attachments on the test plan.


find_real_file.png


That would indicate the file is stored somewhere else. Can you share a screenshot of the sys_attachments list (sorted by descending updated date)?