Testing Alfresco Webservices with soapUI

Introduction

Alfresco ECM has a WS layer that implement all content management services as upload, search, transform, checkin/checkout, etc of any content stored in the repository.

This WS layer enables to Business Application easier integration of content management functionalities. It is only necessary to invoke the Alfresco’s WS for the desired functionality. Alfresco has two types of WS set, one set implements WS of specific way and the other WS layer follows the CMIS standard, in the end, both layers offer the same services in an equivalent manner.

Design of Test Master Plan: Define the scope

For testing purposes, I recommend that you first define the scope of testing:

  • What do you want to test?:
  • How much you want to test?: type of test, i.e. regression, load test, etc.

Then, you create a Test Suite with several test cases as many as you want to execute functionalities or WS.

Implement Test Suite with soapUI

  1. Identify URL/endpoints for each functionality to be tested
  2. Create test-cases for all functionality to be tested
  3. Automates each test case with soapUI by programming with groovy (soapUI scripting)
  4. Add indicators to measure the performance

Run Test Suite

Define the initial conditions to execute the test, for example, time of execution, ignore errors, etc.

soapUI Launch TestRunner settings

Alter a quick introduction, now will test Alfresco ECM, firstly, we will do queries to Alfresco’s Dictionary, after, and we will automate the creation of content in Alfresco.

Test Suite sample: “Testing Alfresco’s Dictionary Service”

soapUI Test Suite – Alfresco’s DictionaryService

Steps in the test suite:

  • startSession:

We must be authenticated before accessing resources Alfresco. We must invoke the URL (http://localhost:8080/alfresco/api/AuthenticationService and startSession method/service) passing username/password, Alfresco should respond by sending a TICKET_ID.

StartSession SOAP request in Alfresco

StartSession SOAP response in Alfresco

  • Queries: getAssociations, getClasses, getProperties, …

For each SOAP query, we must identify SOAP endpoint (for example, http://localhost:8080/alfresco/api/DirectoryService and getAssociations) and method/service, then web have to pass a valid TICKET_ID.

GetAssociations SOAP request in Alfresco

This process we must repeat for each step (SOAP endpoint and method/service) that we identify in our tests.

  • endSession:

For close session we have to invoke to http://localhost:8080/alfresco/api/AuthenticationService and endSession method using the initial TICKET_ID created in step 1.

I have created two Test Suites with soapUI that you can import to workspace.

The first make several queries to Alfresco’s Dictionary (in this case you need to modify the standard content model of Alfresco or simply edit each test step of this soapUI project). The second test suite creates new content in the guest_home space and then transform to PDF.

* Download soapUI project for Alfresco v. 3.4d

I hope that is useful.

@Chilcano

Posted in ECM
9 comments on “Testing Alfresco Webservices with soapUI
  1. Cris says:

    Great tutorial.

  2. nm says:

    Thank you!
    without this tutorial I was not able to start studing Alfresco Web services.

  3. Hi,
    I downloaded and tried your SOAP UI project on my pc. Trying to execute the script I got a groovy error:

    groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.split() is applicable for argument types: (java.lang.String) values: [ ] Possible solutions: split(groovy.lang.Closure), split(groovy.lang.Closure), wait(), sort(), toList(), tail()

    any help?

    Thanks
    — Marco

  4. Pooja says:

    Good post, can not able to download the sample project

  5. Jaco says:

    Trying to download your SoupUI project, I’m getting error 404 “Can’t find the page…..”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
%d bloggers like this: