Service Virtualization

 View Only
  • 1.  Download mar file in devtest test case

    Posted May 03, 2020 02:55 PM
    Hi, 

    I am trying to download the mar file using LISA Invoke 2.0 api in a DevTest  testcase. Below is the api i am using 

    /VSEs/{serviceName}/{virtualServiceName}/actions/getMar

    Could someone please guide how to download a mar file using the lisa invoke 2.0 api in a lisa test case..


    ------------------------------
    Thanks,
    Varun Chand
    ------------------------------


  • 2.  RE: Download mar file in devtest test case
    Best Answer

    Posted May 04, 2020 12:59 AM
    Hi Varun,

    LISA Invoke APIs are for executing the testcases, suites and MARs.

    If you are using 10.5 or above version:
    ---------------------------------------------
    You can use Service Virtualization API v3 to download the mar files via http call.
    Below is the syntax for the same:

    GET /vses/{NameofVSE}/services/{NameofVirtualService}

    This endpoint either retrieves information about an existing virtual service or gets the existing virtual service as a MAR file. You control which function is performed by setting the response content type header.

    -----------------------------------------------------------------------------------
    If you are using version < 10.5

    Use Virtual Service Invoke API in 2 steps

    1. Get the vse ID:
    GET /vses
    2. Get the list of VS:
    GET /vses/{vseId}/services
    3.Download the mar
    GET /vses/{vseId}/services/{serviceId}

    Thanks.


    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 3.  RE: Download mar file in devtest test case

    Posted May 10, 2020 01:53 PM
    Hi Vaibhav,

            I am using Devtest 10.5 version and I did try service Virtualization api in postman and am able to download the MAR file. However when i tried creating a devtest testcase am unable to download the same. 

    Below are the steps i have tried
    1) Created a HTTP/HTML Request step
    2) Created a REST api step
    3) Added header "accept:application/zip"

    But it did not work in any of the case. Is there anything i have missed to add here.


  • 4.  RE: Download mar file in devtest test case

    Posted May 10, 2020 03:19 PM
    Edited by Vaibhav Jain May 10, 2020 03:46 PM
    Hi Varun,

    I believe, you may not be able to download the mar from API in DevTest Testcase, as there is no out of box feature to save the attachment.

    You can use curl to do the same in test case.

    Thanks.

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 5.  RE: Download mar file in devtest test case

    Posted May 30, 2020 04:04 PM
    ​Thanks Vaibhav, I was able to download using the curl command.

    ------------------------------
    Thanks,
    Varun Chand
    ------------------------------