Antoine_Sauteron_1266

AE 12.1 - Test Automation Engine REST API with SOAP UI - beginner level

Discussion created by Antoine_Sauteron_1266 on Dec 5, 2017
Latest reply on Feb 16, 2018 by joel_wiesmann_automic
Hello,

As some support cases recently came in about this feature, I thought it may be interesting to see a simplified use case of the AE REST API.

We'll see how to generate a REST API call to activate a script and pass a variable at activation.


1 - Create a simple job or script with the following attributes

  • "Generate at runtime" is enabled
jt5xv89q4dos.png

  • Process or pre-process tab contains one or several:READscript statements to receive the variable sent by the API.

Example : SCRI.STARTED.VIA.REST_API
:READ &VARA_SENT_BY_REST#,,
:PRINT &VARA_SENT_BY_REST#


2 - Create a new REST Project under SOAPUI


The url must be <Automation Engine's server hostname>:<port of the JCP>

wvi5fp9c41ub.png


Set the request as follows:
  • Method : POST
  • Resource : ae/api/v1/<client #>/executions

sgham4m5i0pa.png


Set the "media Type" to "application/json" and type in the query below:

t26j6joica9w.png

{
     "object_name":"SCRI.STARTED.VIA.REST_API",
     "inputs":
     {
          "VARA_SENT_BY_REST#":"Variable successfully sent"
     }

}

Type in your AE user credentials in the "Request Properties"

egu2uvlolyin.png


3 - Run the REST call


Your objects should now be ready to use. Just hit the "Play" button :

 la5p84v954n3.png

And look for the results in the JSON section:

ozp8kwhea0j2.png


You can see the task was activated in the Process Monitoring tab:

4h5l8vbv261s.png

And the variable set in the REST call was successfully passed on to the script:

u6xptt11ad72.png


Best regards,
Antoine

Outcomes