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

Chuck Tomasi
Tera Patron

Attachments are saved in the sys_attachment table with references to their 'native' record. If you look in the sys_attachment table (type sys_attachment.list in the application navigator filter) and sort by descending updated date, you can identify which table it is attached to.




find_real_file.png



find_real_file.png


Hi



Is it possible to view the attachment from a form somewhere, as I would like the test manager (not administrator) to be able to view the attachments that the testers upload?


Yes, Once you know the table, you can view it on that form via the standard means. I was merely providing a way for you to determine which form it is on. Sorry for the confusion.


If you see recent table entries in the table 'test_case', then you can use the navigator filter to go to test_case.list (or the appropriate module that takes you to the same table) - for example.