Abhinaba Frequent Contributor.
Frequent Contributor.
830 views

Need Help on trigerring test-set via ALM REST API.

Hi All, can you help me with a suitable POST method to trigger ALM test-set via ALM REST api. Is there any method availble for it like below:

http://YourALMServerAddressHere:8080/qcbin/rest/domains/YourProjectDomainHere/projects/YourProjectHere/test-sets/YourTestSetIDHere/startruntestset

Can you help me with something similar? or still dont have anything availble like this from HP?

0 Likes
15 Replies
jairo salazar Respected Contributor.
Respected Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Hi, You can find the complete solution here : http://automationtweak.blogspot.in/

0 Likes
Abhinaba Frequent Contributor.
Frequent Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Hi,

I have not got my answer in the blog. just for clarification, i am placing my question again, is there any POST method avilable to "Trigger" the alm test set (similar to hit the start button in alm GUI)? I am not talking about updating a run status, i want trigger ALM Test Set execution via ALM REST API. will be greatefull , if you can provide me correct resource for that.

Many thanks in advance.

0 Likes
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: Need Help on trigerring test-set via ALM REST API.

resttrig.png

0 Likes
Abhinaba Frequent Contributor.
Frequent Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Hi Aricht. Many thanks for your suggestion, 

I have tried the same as per your suggestion and got thye below error:

Request:

POST: https://**/qcbin/rest/domains/**/projects/**/test-sets/16186/startruntestset

<Entity Type="Functional Test Set">

<Fields>
<Field Name="duration"><Value>30</Value></Field>
<Field Name="vudsMode"><Value>false</Value></Field>
<Field Name="reservationId"><Value>-1</Value></Field>
</Fields>
</Entity>

 

Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QCRestException>
<Id>qccore.operation-forbidden</Id>
<Title>Access to this resource has been denied</Title>
</QCRestException>

 

0 Likes
Barath123 Regular Contributor.
Regular Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Did u get any solution for the above forbidden error. We are also facing the same issue?
0 Likes
Barath123 Regular Contributor.
Regular Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

We have tried to run the test instance as stated, but we are getting the below error.

{
"Id": "qccore.operation-forbidden",
"Title": "Access to this resource has been denied",
"ExceptionProperties": null,
"StackTrace": null
}
0 Likes
Abhinaba Frequent Contributor.
Frequent Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

hi we get the solution a few days ago.

The request message structure is quite fine. This error is coming as the target user dont have enough rights.

The desired configuration can be achieved through below setps:

1. "Lab Extension" for Functional Testing is enabled for the current project via ALM "Site Admin"

2. Access to ALM.Net modules "Lab Resources > Testing Hosts" and "Testing > Timeslots" is configured. This has to be done for the Test Manager as well as for the technical user. 

3. In general the Lab Admin Group has to be set for the user. This should contain following rights:

  • Run > Timeslot ID
  • Run > Start Test Set Run
  • Run > Stop Run

Best of luck !

echap13 Contributor.
Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Any clue why I still receive access denied when...

1.  Lab Extension is enabled in Site Administration

2. The user making the REST call has access to ALM modules "Lab Resources > Testing Hosts" and "Testing > Timeslots". 

3.  The user making the REST call is an 'Administrator' with rights to everything, including Run > Timeslot ID, Start TestSet Run and StopRun.

 

Thanks 

 

0 Likes
Visitor.. Sebastian123
Visitor..

Re: Need Help on trigerring test-set via ALM REST API.

@Barath123, @echap13 

Hello Barath123 and echap13, could you solve your problem?
We have the same error message.

"Id": "qccore.operation-forbidden",
"Title": "Access to this resource has been denied",

Do you have any advices besides the already made? What was exactly your missing privilage which lead to this error?

 

 

0 Likes
echap13 Contributor.
Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

@Sebastian123 

I have not resolved this issue yet.  I have a ticket open but it's not getting far. 

 

@arichtman 

Any idea arichtman?  I'm using postman for my testing.  Any help would be appreciated.

0 Likes
Barath123 Regular Contributor.
Regular Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Hi All,

I've been following up with Microfocus and got a responding from them and I can conclude that Microfocus doesn't have an API enabled / available to trigger the run but there is an exe called Runtestset.exe or RunTestSetScheduler.exe via which you can run the QTP Tests. Also make sure that both ALM and QTP are in same machine.

 

I've tested and its working correctly. So no APIs available in any version of ALM to trigger the run.

 

Thanks.

0 Likes
Highlighted
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: Need Help on trigerring test-set via ALM REST API.

I know it's dumb but can the user start the tests using the UI? This does sound like a permissions issue at this point - though it seems like you've covered your bases? I'd say next step is full debug logging and see what's different b/w starting runs with REST and with GUI .
0 Likes
Barath123 Regular Contributor.
Regular Contributor.

Re: Need Help on trigerring test-set via ALM REST API.

Hey @arichtman ,

I also checked the same with microfocus team on this and ask I said earlier they don't have an API endpoint available to run the Test Cases if they had one they would have documented that right? but they didn't. And they provided me the only solution to trigger that exe with some arguments to be passed and it satisfied my need.

I want to share the news to others so that they start working on the alternate approach not to depend on API endpoint.

 

And there won't be much different on REST and GUI based testing.

Visitor.. Sebastian123
Visitor..

Re: Need Help on trigerring test-set via ALM REST API.

@Barath123: Thank you!

 

@Micro Focus Communit: It is really disappointing that running Tests and Test Sets with REST is not possible (and not documented). We want to run a Test with a simple REST call from an unix-shell (unix server) and of course without installing ALM/UFT (on the "calling" machine).

Would be nice to see enhanced and documented REST API in the future.

Best regards
Sebastian

0 Likes
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.