Through Rest Api,You can create run for each of the test instance in a test set and update each of the step through run-steps of that particular test case while execution.
While creating the run you have update following mandatory field:-
http://<server>/qcbin//rest/domains/<>/projects/<>/runs/
<Entity Type=\"run\"><Fields>
<Field Name=\"name\"><Value>Run_2015-04-15</Value></Field>
<Field Name=\"testcycl-id\"><Value>573269</Value></Field>
<Field Name=\"cycle-id\"><Value>4363</Value></Field>
<Field Name=\"test-id\"><Value>29201</Value></Field>
<Field Name=\"subtype-id\"><Value>hp.qc.run.MANUAL</Value></Field>
<Field Name=\"owner\"><Value>owner</Value></Field>
</Fields></Entity>
After creating run ,you need to fetch Run-ID{Run ID} from the generated Response Xml
/qcbin/rest/domains/{domain}/projects/{project}/runs/?query={name[Run_2015-04-15]}
-use this url to get {Run ID}
will be used to update steps.Used in following Url
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/
For run-steps:-
To get the ID for the particular Step (like Step 1,2...).Use following query url.
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/?query={name[Step 1]}-use this url to get Step ID {ID}.
To Update Step:-
1. Use following url:-
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/{ID}
2.Generate the Xml and use post method to update status field.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Entity Type="run-step">
+ <ChildrenCount>
<Value>0</Value>
</ChildrenCount>
- <Fields>
+ <Field Name="test-id">
<Value>6</Value>
</Field>
+ <Field Name="comp-status">
<Value />
</Field>
<Field Name="rel-obj-id" />
<Field Name="obj-id" />
+ <Field Name="has-linkage">
<Value>N</Value>
</Field>
+ <Field Name="execution-date">
<Value>2017-09-25</Value>
</Field>
+ <Field Name="path">
<Value />
</Field>
+ <Field Name="desstep-id">
<Value>1031</Value>
</Field>
+ <Field Name="attachment">
<Value>Y</Value>
</Field>
+ <Field Name="has-picture">
<Value>N</Value>
</Field>
<Field Name="tree-parent-id" />
+ <Field Name="id">
<Value>24820</Value>
</Field>
+ <Field Name="component-data">
<Value />
</Field>
+ <Field Name="bpt-path">
<Value />
</Field>
+ <Field Name="actual">
<Value><html><body> Results match expected </body></html></Value>
</Field>
+ <Field Name="step-order">
<Value>1</Value>
</Field>
<Field Name="level" />
+ <Field Name="expected">
<Value><html><body> <div align="left"> <font face="Arial"><span style="font-size:8pt">Successful launch of website</span></font> </div> </body></html></Value>
</Field>
<Field Name="line-no" />
+ <Field Name="comp-subtype-name">
<Value />
</Field>
- <Field Name="extended-reference">
<Value />
</Field>
- <Field Name="name">
<Value>Step 1</Value>
</Field>
+ <Field Name="execution-time">
<Value>03:56:29</Value>
</Field>
+ <Field Name="bpta-condition">
<Value />
</Field>
+ <Field Name="user-template-01">
<Value>Website Tester</Value>
</Field>
+ <Field Name="parent-id">
<Value>1522</Value>
</Field>
+ <Field Name="user-template-03">
<Value />
</Field>
+ <Field Name="bpt-facet-type">
<Value />
</Field>
+ <Field Name="user-template-04">
<Value>kama</Value>
</Field>
- <Field Name="status">
<Value>Passed</Value>
</Field>
</Fields>