How to update result using REST API in HP ALM or QC? - rest

I am trying to update the test results in QC using REST APIs. First of all, is this possible?
Now I do believe that this is possible and should be a fairly straight forward thing. But I am not able to find the right way to do this. Here is what I am doing:
Run tests through Jenkins using my own automation tool. This tool gives me the results which I need to populate back in QC/ALM.
Now after the entire run, I want to populate the pass/fail status in QC. Lets say I have just one test case for simplicity. How should I go about this?

it is indeed possible to use REST API to manipulate HP ALM entities. For example we're using it to update execution status of test campaign run in SoapUI automatically into ALM.
Did you have a look at official HP ALM REST API documentation? You should be able to access it from inside HP ALM GUI (Help menu/Documentation library/HP ALM REST API Reference). It describes the API in detail.
You can also have a look at HP ALM forums where this issue have been asked several times already:

Related

Deploy application in IBM Cloud using only Rest API

I am an intern and currently doing automation on a software. What I need to do is to automate the process of creating, and starting an application in the cloud foundry using Rest API (rest-assured). I can't start an app because to start it I need to upload bits. I searched for weeks and still cannot find how to do it. I can only use V2 of the Cloud Foundry API, because when I create an app using the V3 API it doesn't show in the dashboard. I don't know why so we decided to just leave it and use V2 instead.
My question is: Is there any way to create, and deploy/start an app using only Rest API with the V2 API of the Cloud Foundry API? If there is a way to do this by using V3 API, I'm willing to search for the solution to solve the issue.
Thank you very much.
I think others commented on your question to use the cf command line, but if you want to use whats behind the scenes of cf then you can refer to the REST API Docs. At the top the page there is a API version selector (I linked 2.9.0 since you mentioned V2).
More specifically, to create an app you can use the Create App Endpoint; then to upload the bits, you can use Upload Bits Endpoint.
I hope this helps. Definitely check out the main docs, there are tons of endpoints that might be useful. Good luck on your internship!
EDIT: Just in case you need the CF API URL its https://api.ng.bluemix.net
If you want to see how the cli uses the rest api behind the scenes you can temporarily set the environment variable BLUEMIX_TRACE with the command line EXPORT BLUEMIX_TRACE=TRUE.
Then you can try doing cf push or cf start, cf stop, etc, and you will see the http requests the CLI uses. This has helped me a lot versus digging through the CF documentation :). Hope it helps!
I solved it by combining V3 API with V2 API. I understand the upload bits in V3 API. I use link[1] mainly to start the app. I think you can't create a route in V3 API because I don't see any endpoint for that, so I use V2 API instead to create and assign. I also use V2 API to create my app because of what I stated in my question. Thanks for answering the question because without the answers given by good people here I can find the best way to solve this.
[1] Create an App using V3 : https://github.com/cloudfoundry/cloud_controller_ng/wiki/How-to-Create-an-App-Using-V3-of-the-CC-API
[2] V2 API doc : https://apidocs.cloudfoundry.org/3.1.0/routes/list_all_apps_for_the_route.html .
[3] V3 API doc : http://v3-apidocs.cloudfoundry.org/version/release-candidate/index.html#get-assigned-isolation-segment

REST call to insert records in another sandbox through Apex code

I am looking for exact apex code to fetch records from current sandbox and insert it into another sandbox. I am fine with both REST or SOAP API, please share the apex code if possible.
Looks like you can solve it using one of ETL-tools without writing REST services and Apex code. There are a lot of ETL-tools, which supports Salesforce, for instance Talend open studio, DreamFactory Monarch or Pentaho Kettle.
More broad list of tools with descriptions you can find on Awesome Salesforce page.

ALM Process Automation

We are using HP ALM for QC in our projects and we are planning to automate the following things uisng HP ALM's REST api.
1.Dynamically upload the test cases in Test Plan and Test lab.-From the api code sample i can understand that TC's are upload to Test lab by creating test set folders.But how to upload the TC's in Test plan ?
Map the test cases in Test plan and Test lab -No where i have seen any examples which explains how to map the TC's in Test Plan and Lab.
3.Dynamically update the status of the test cases with Success or failure.
4.How to map the TC's with work items ?
Can you please advise us that the above items are achievable ?
of course what you mentioned is possible. First of all it may be different on the HP QC REST ALM version you are using. For instance not all the features are enabled on the first 11.x version, but most of bugs got fixed in the 12.53 for instance.
Anyway coming to your point:
1) Always refer to the HP REST ALM library to check the REST msg you should send:
http://alm-help.saas.hpe.com/en/12.53/api_refs/REST/#Overview.htm
2) You have to choose a way to send and receive those msgs. Nowadays it is quite common the usage of python (I am using that). Please have a look at the "REQUESTS" module that will fit for this task!
First action is to login/authenticate into the QC ALM, then you can start sending next operation according to the library above and keeping the correct information in the header (for instance the LSSOCookie).
3) Plenty of questions are already answered on stackOverflow. Always try to check a specific task.
4) Coming to your questions: if test-set-folders is used for folders in test lab, then test-folders is used as entity for the folder under Test Plan.
Entity= "test-instances" is used then to link a Test Case to Test Set :-)
To update a test-set or test-case you have to send a proper update for that. (some bugs are visible in that area for the HP 11.52 --> for instance before create a test as "No-run" and then update to "pass or fail". This you will experience after you have implemented first points.
you can then create run, run-steps, design-steps, attached files and whatever is mentioned on the HP ALM library.
Please vote the question if this solved your query ;) that you can close the same! I wish you luck in your project! ciao ciao!

Unable to get Requirements coverage information from QC 12 via REST api?

Unable to get Requirements coverage information from QC 12 via REST api?
I am using QC 12 in my project. Can anyone tell me is it possible to get test coverage information from requirements via QC 12 using REST api?
Rest api is preview version and not fully available as OTAClient api. Many functions are not available. Few enhancements are made in 11.5 and 12.0/2 but still it lacks many of the function. Better you use OTAClient which is full fledged api to communicate with HP.
Only requirement traceability links are added in rest version of 12.0/2
there is a possible workaround for that. First point should be the usage of a QC version higher than 11.
Having said that, it is possible to use a call to "requirement-coverages" and check for the required "required-id", for instance:
1)
GET https://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/requirement-coverages?query={requirement-id[10];}
This will give you back an xml file (in case requirement exist) with a list of "test-ids" linked to that requirement.
Already at this point you have the knowledge of "test-coverage"--> each test cases will have his own "pass or fail".
2) If you are looking for a specific test-id, then you can check if in those test-ids is available the test-id you are looking for.
Hopefully the command above solve your query. I know that this is quite late reply, but hope to help somebody else! Have a nice day.
Try this api. You will get all the requirement to requirement mappings.
http://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/req-traces?login-form-required=y
Also if you need a list of all the api's exposed in REST, use the below link:
http://SERVER/qcbin/rest/resource-list .

How to perform load test on rails based RESTful API?

this might be wrong to ask here but Can anyone suggest me a tool to test a rails based RESTful API? I need to perform load or stress test on this API and also i should be able to write script i need. Basically what i need is a load test tool to test a rails based REST API with script.
P.S.: it should be freeware also.
You can use AgileLoad to load test a RESTful API. It is free for scripting and small test, but have a license to be paid for more than 50 concurent users I think. The support team is quite proactive and can help you with advanced scripting features. They have also some tutorials and how to's available on their website.