The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot add attachments to test execution created by automation

Shrikant Singh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 5, 2022

Hi,

I am using Adaptavist python module for automating our test execution. Using clone_test_run api for cloning a reference test run(test cycle). Then I use edit_test_result_status api for updating the test results. Next what I want to achieve is adding attachment (evidences) to test. For that I tried to use add_test_result_attachment api.

I observed a weird problem: If the test run is created manually, I could add an attachment using add_test_result_attachment without any issue. But when I call same API for a test run which is created automatically(using clone_test_run api) , I get keyError.

 

Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
adaptavist_obj.add_test_result_attachment("NPUI-C8", "NPUI-T3", r"D:\WorkflowTeam\Squish_PoC\client.log", "New")
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\adaptavist\adaptavist.py", line 882, in add_test_result_attachment
test_result_id = self.get_test_result(test_run_key, test_case_key)["id"]
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\adaptavist\adaptavist.py", line 766, in get_test_result
response = self.get_test_results(test_run_key)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\adaptavist\adaptavist.py", line 711, in get_test_results
result["scriptResults"] = sorted(result["scriptResults"], key=lambda result: result["index"])
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\adaptavist\adaptavist.py", line 711, in <lambda>
result["scriptResults"] = sorted(result["scriptResults"], key=lambda result: result["index"])
KeyError: 'index'

Can anyone suggest a workaround or any solution for this?

 

Thanks

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events