Lieutenant
Lieutenant
1033 views

Manual Test Data Set accessible using REST API?

Jump to solution


Hello.

Test Steps and Test Runs are accessible using REST API. Is it possible to use REST API to read and write the Data Set values belonging to a Test?

- If yes: could you give me an example using cURL?
- If no: is there a workaround or is it planned to get that feature in Octane?

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Hi,

You could try the depricated header "HPECLIENTTYPE" with value "HPE_REST_API_TECH_PREVIEW" to access private elements.

This header is depricated since Octane 12.60.4 so you perhaps have to activate the old header; have a look at the Online Help / Setting configuration parameters.

Regards,

Dirk

View solution in original post

5 Replies
Lieutenant
Lieutenant

I do not know if my question was clear enough. Basically I am just asking if there is a way to get the values of a Data Set (from a Data Table) using REST API or something (cf. the red arrows on the picture below)?

Any help would be welcomed since I cannot find any information on Octane Data Set and REST API.

dataset.png

0 Likes
Micro Focus Expert
Micro Focus Expert

Hi,

I've not yet worked with the test data table via the REST API - and it's not recommended to do so at the moment, test_data_table currently has the access level "private":

Octane Entities.jpg

 

These are the fields of the entity test_data_table (sorry, my Excel is currenty set to German - "wahr" means "true", "Falsch" means "wrong"):

Test Data Table - Fields.jpg

 

These screenshots are from the GDPR Content Pack (https://marketplace.microfocus.com/appdelivery/content/gdpr-content-pack); you can use it to analyze the Octane entities and fields on your Octane environment.

Regards,

Dirk

 

Lieutenant
Lieutenant

Hi Dirk,

Thanks for sharing that information. Actually that is what I was looking for.

A get request in REST API using the URL "http://octane_server/api/shared_spaces/XXXX/workspaces/YYYY/data_sets" indeed returns a "403 Forbidden" HTTP answer.

So I believe there is no way with the current version of Octane to use the parameters inside a data set with REST API.

Regards.

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Hi,

You could try the depricated header "HPECLIENTTYPE" with value "HPE_REST_API_TECH_PREVIEW" to access private elements.

This header is depricated since Octane 12.60.4 so you perhaps have to activate the old header; have a look at the Online Help / Setting configuration parameters.

Regards,

Dirk

View solution in original post

Lieutenant
Lieutenant

Dirk,

You are totally right and I was wrong: it is possible to get parameter values from REST API using the header parameter you mentioned.

I write down my testings since it could help others.

1) First, using cURL, I get the information on my test (its number is 166437).

curl -v -b /tmp/cookies -k -H "Content-Type: application/json" -H "HPECLIENTTYPE: HPE_REST_API_TECH_PREVIEW" -X GET http://octane_server/api/shared_spaces/XXXX/workspaces/YYYYY/tests/166437 | python -m json.tool

I got that:

[...]

"subtype": "test_manual",
"subtype_label": "Manual Test",
"test_data_table": {
"activity_level": 0,
"id": "57001",
"name": "my_table",
"type": "test_data_table"
},

[...]

 

2) I noticed the "test_data_table" element you brought to my attention with the value 57001. Then I run a second REST API request with cURL using "test_data_tables" and the value I just found (i.e 57001).


curl -v -b /tmp/cookies -k -H "Content-Type: application/json" -H "HPECLIENTTYPE: HPE_REST_API_TECH_PREVIEW" -X GET http://octane_server/api/shared_spaces/XXXX/workspaces/YYYYY/test_data_tables/57001 | python -m json.tool

And I got:

[...]

"data": {
"data_sets": [
{
"id": "20001",
"iterations": [
{
"Family_name": "Marley",
"First_name": "Bob",
"Phone": "123.456.789"
}
],
"name": "Default Data Set"
}
],
"parameters": [
"First_name",
"Family_name",
"Phone"
]
},
"description": null,
"id": "57001",
"last_modified": "2019-06-25T10:54:29Z",
"name": "my_table",

[...]

 

I can see the table name, the data set name and its values (the parameters and their values declared in the field "iterations").

I do not know if it is possible to get "iterations" field content directly without JSON parsing. The data set requests do not give the parameters values if we use requests ending with "data_sets/data_set_number" but requests with "test_data_tables" do the job.

Thanks a million.


The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.