Integration with Zephyr Scale

Hi !!!

I’m trying to integrate Robot results with my test cases that are in Zephyr Scale within Jira. I followed the tutorial available on the SmartBear page but I was not successful.

Has anyone had success with this type of integration?

Tutorial link: Robot Framework Integration | Zephyr Scale Cloud Documentation

I’ve tried following the steps in this example, but as you can see it doesn’t work.

I’m newbie forgive me if there is any stupid mistake !!!

Anyone who can help with guidelines I’m very grateful!!!

I am also looking for this. Did you get any solution?

Hi Thiago,

FYI - I’ve never used Zephyr Scale, so take my comments with a grain of salt :grin:

I had a quick look at the documentation and noticed:

Run robot with switch to generate a JUnint XML file:

robot -x junitresult.xml mytest.robot

Then " Uploading results to Zephyr Scale"

curl -H "Authorization: Bearer ${TOKEN}" -F "file=@TestSuites.xml;type=application/xml" https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey="JQA"&autoCreateTestCases=true

If you’re following this example exactly you’d probably get a file not found for TestSuites.xml from the curl command.

I think it should be either:

robot -x junitresult.xml mytest.robot
curl -H "Authorization: Bearer ${TOKEN}" -F "file=@junitresult.xml;type=application/xml" https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey="JQA"&autoCreateTestCases=true

or

robot -x TestSuites.xml mytest.robot
curl -H "Authorization: Bearer ${TOKEN}" -F "file=@TestSuites.xml;type=application/xml" https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey="JQA"&autoCreateTestCases=true

I.e. the xml file name should be the same in both commands.

Hopefully the problem is that simple :crossed_fingers:

Dave.

Do we need to run Curl command in where we run robot run commands?

Yes wherever you run the robot command, just make the curl command the next one, you could even bundle them in a batch/shell script if that makes your life easier.

I expect you don’t have to use curl, you could use any http client, just the example given was curl so you just have to replicate that http request with your preferred tool.

As I mentioned, I never did this myself, I just showed what I found in their documentation.

Dave.

Thanks Dave.

I am getting below error

That looks like an operating system error message

  • do you have curl installed?
  • is it in the path variable?

If you don’t know how to check tell me what operating system you are using and I’'ll try and help.

Dave.

Yes I added in Env path variable also

Also I am using pycharm IDE ( I did install some curl addon in pycharm)

Did you close and reopen pycharm after installing curl? Often you need to do this on windows for the app to recognise the path update.

After that if your still getting this error:

Then can you show the robot script where you’re calling it and perhaps we need to make adjustments to that.

Dave.

First I executed robot command and created automation.xml and then I ran curl command. See below error msg

Access Denied

I have a couple of ideas what the issue could be:

  • Access Denied is usually an authentication or permissions issue
    • it could be your windows user is getting a permissions issue when trying to run curl? I would expect this is not the issue since you ran curl -v without issue, but try running this command from that command window and make sure it works?
      • About the command window you ran curl -v in, you didn’t open that by “Run as Administrator” by any chance? If you did, this would make this point more likely to be the issue.
    • It could be user / pass combo is wrong though I would expect something like authorisation required for that
    • I see you are on windows, does the server use your windows username and password? If so maybe you need to send the username as DOMAINNAME\\USERNAME rather than just USERNAME?
    • Does this user have permission to the project with project id 10700? is there even a project on your server with that project id? if either is no that would explain the error
  • It’s unusual to see double quotes (") in a url especially for a value that looks like an integer, so perhaps projectId="10700"& should be projectId=10700&? though I would expect a 404 not found if this was the problem I can see how this could give an Access Denied

The good news is you got past the previous issue, it’s finding and running curl,

Hopefully one of these leads you to the issue,

Dave.

Is Personal access token different from zephyr scale API access token?

I do see only Personal access token in my profile.

image

Hi @grarun11 ,

I have digged into this to research for apply Zephyr with Robot on my company. Found you’re having the same issue with me.
I think you’re reading the wrong document, because base on your Zephyr Urls, you’re using Zephyr Scale Server not Zephyr Scale Cloud.
So that the API endpoint is not correct. You can try follow this documents.
Zephyr Scale Server API (v1) (smartbear.com)

Nam Truong.

1 Like

We don’t use zephyr scale cloud. We have only zephyr scale.

@tntnam I downloaded postman to upload the result. Not sure how to generate Bearer token for authorization. I see only personal token under my profile.

image

That looks like an operating system error message

That error was definitely a user error. OP passed the “curl” to the robot and robot is telling there’s “no such testsuite”