ALM Process Automation - rest

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!

Related

Best way to Test an API Web Service using Automation

I am looking for the best way to test this scenario using automation. Before you mention or ask, yes, i have throughly searched to make sure or even get info or knowledge on this topic.
I have a web service that provides various pricing for health insurance. The pricing is based on different class category of race, age, location etc. All that is inputed into the web service to get the fee for the client.
Right now everything is done locally with SoupUI. As you know SoupUI does not have a way for you to randomly change the data in the body, but i need a way to automate this so random age, race, location, etc can be inputed in and verify the result against a CSV file with the information.
Is this possible or is there a better way to test this web service?
-
Per #lloyd request, because he is King here and other known methods i know:
UI Option: We build a UI to interface with the API and use Selenium to run the countless scenarios we have, but they do not want to do this. They are more incline on testing the API itself.
Ruby: Use Ruby to connect to the API, using Rspec and Airborne (https://github.com/brooklynDev/airborne), the downsize of this is also the same as using SoupUI. Everything is entered in manually, and the code just runs through the various variations we have to get the return and match it against what it should be.
I also found another tool, https://assertible.com/ but the downsize of that is we cannot limit the random generator between 2 selected numbers, plus no way to do the comparison.
Then there is Postman, which is also similar to SoupUI so not a real automation since we cannot change the values in the body. http://blog.getpostman.com/2015/09/03/how-to-write-powerful-automated-api-tests-with-postman-newman-and-jenkins/

API test report?

I’ve been working as an API test engineer for four months. I’m creating API testing framework from scratch. I use Postman to maintain and store my test scripts and use Newman to run my test collection on Jenkins server. But I don’t receive good reports about test results and my manager requires providing graphical weekly and monthly reports about API testing. When I was working as a GUI test automation engineer I used Allure report and I was more than happy with it because I received graphical information about my tests. And I really need kinda the same result for my API testing. Does anybody know how can I do it? If you know how can I get similar result like on screenshot just provide me the name of the tool or basic plan and I will be happy. Thanks!
***attached screenshot is allure report. I use it to get report about Selenium web-driver test results. Example of report that I expect but for API
When i was testing, my company had this software to help me with testing:
https://www.soapui.org/
But it is not free.
Best
I use console.log statements in my postman test scripts. When I run the tests with newman, I capture these statements in a file. This is one way of reporting each failure (or whatever you wish to report). In my case I am formatting the output as a comma-delimited output, so I can import into excel and organize that way.
I compile summary reports by using newman as a nodeJS module. As the test is running, I use the events to capture statistics such as response time for each request. I can capture additional information about requests that timed out or failed. When the collection is finished, I can calculate average response times, overall error rate, etc and persist the summary report to a file.

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 update result using REST API in HP ALM or QC?

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:

Is it possible to inject test cases into soapui at runtime with test runner?

I am trying to determine whether I am able to inject test case information at run time and leverage the SOAPUI tool. I understand that I can create test cases on the GUI but is this my only option?
Background info if interested: Currently I am working on creating an automation framework at my company. We currently have web page testing and soon to be added SOAP testing. As many of these tests (at one point in the future as I am told my the architect) could be run from both a web page and soap I think it's best to store the test cases in some format (Json, YAML, etc.) to document all the test cases and then inject them into test steps at run time.
However my company enjoys working with SOAPUI. I've used the tool and created test cases, assertions, et al on the GUI (of course) but I cannot find any documentation which suggests that instead of defining the test cases in this way I could inject the test information at run time (similar to what you can do with the wsdl2java apache tool). Can this be done with testrunner? This way I can reuse the test cases. Is this possible? Does this even make sense? I just want to attempt to incorporate a tool I've been asked to use.
Any thoughts are greatly appreciated!
Here is an example of what data may look like:
Partner : [
Organization : [
Company Name:
Company URL:
]
Contact Information : [
Name:
Address:
]
] (sorry i can't get the indents to work properly...)
As I stated below in a comment, I know on the SoapUI GUI I can create a test suite, test case and add test steps. But I want to store the test step information in a different place so I can use the test steps for different kinds of tests.
Your question is way too broad for me to even attempt a complete answer.
SoapUI GUI you use to create the tests. Your data can be stored, and read by SoapUI, in Excel, database, flat file, generated dynamically, whatever you want. You can run everything using the testrunner from command line, or using the Maven plugin from Jenkins.
Seriously, spend some time with the documentation.