wishper wishper - 1 year ago 118
reST (reStructuredText) Question

Set test parameter in test instance using HP QC REST API

Is there any way to create test instance with parameter using the REST API on QC 11 ?

I have a test in my test plan with some parameters, or just one for the exercise :
qc parameters

I want to create using the rest API :

  • A test set in my test lab

  • A test instance in this test set

  • A test run of my test (the one in the plan) in this test instance

  • And be able to set the value of my parameters

I have manage to do the first 3 points. But I can not find how to set the parameter value for my instance. If I create the tests manually it is asked during the add of the test in the instance. And I can find the parameters in the Execution Settings in the Test Instance detail :

test instance details

I have search in the documentation, but didn't find anything about how to set/use theses parameters. I have made GET on every objects, but didn't find them. I also try some urls like :


But they always return 404.

Is there any way to set these parameters values ?

Answer Source

I had same troubles and here is my solution.

You can query your test parameters as:


And your test instance parameters, which are effectively actual values for those in your test instance, with:


For parameter values created via UI it returns like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Entities TotalResults="1">
    <Entity Type="step-parameter">
            <Field Name="origin-test">
            <Field Name="vc-user-name">
            <Field Name="id">
            <Field Name="parent-id">
            <Field Name="used-by-owner-type">
            <Field Name="actual-value">
                    &lt;div align=&quot;left&quot;&gt;
                    &lt;font face=&quot;Arial&quot;&gt;&lt;span style=&quot;font-size:8pt&quot;&gt;AAA&lt;/span&gt;&lt;/font&gt;
            <Field Name="key">
            <Field Name="used-by-owner-id">

Where used-by-owner-id is id of the test-instance and parent-id is id of test parameter of the test. Actual value for this case is AAA wrapped up with html tags.

You can create step parameters like this using normal POST to url:


Note: Don't use same nested url for creation as you use for retrieval. You'll not be able to create parameters with such a combination of parameters you need.

API documentation really sucks, but you can get ideas how to retrieve or create things you need by requesting entity schema with

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download