Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,442
Community Members
 
Community Events
176
Community Groups

xray adding evidence to a Execution with api

Edited

i am trying to upload a picture as evidence to a testRun in the execution Issue

 

image_path = "C:/work/screenshots/repo2.png"
is_file = os.path.isfile(image_path)
print(is_file)

def get_base64_encoded_image(image_path):
with open(image_path, "rb") as img_file:
return base64.b64encode(img_file.read()).decode('utf-8')

deco = get_base64_encoded_image(image_path)
print(deco)

data = {
"data": deco,
"filename": "test1.png",
"contentType": "image/jpg"
}

url = "https://my_site/rest/raven/1.0/api/testrun/39340/attachment"
req = requests.post(url=url, json=data, auth=(user, password))
print(req)

but i get 500   i am missing a step? or this is a bug?  i am following https://docs.getxray.app/display/XRAY/Test+Runs+-+REST#TestRunsREST-Evidence,  

 

if i do "get" just to see if there is any evidence (checking if i was able to upload something) i also get 500

 

req = requests.get(url=url, json=data, auth=(user, password))
print(req)

 

1 answer

=( my bad,  i was putting the wrong user and password,   but i was expecting a more descriptive error,  or like run not found, wrong password, you are doing something wrong etc... 500 server error 

Hi @demian kurejwowski ,

I also agree that the error should be more clear.

Some time ago, I've released some collections for Postman as open-source, that contains calls for all endpoints. You may eventually find it useful: https://github.com/Xray-App/xray-postman-collections

 

Regards

Sérgio

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events