Service Virtualization

Expand all | Collapse all

Returning Data from Application Test Script

Jump to Best Answer
  • 1.  Returning Data from Application Test Script

    Posted 08-25-2017 04:25 PM

    Is it possible to return data from an application test script execution?

     

    Scenario

    - Our script is called via Lisa-Invoke to run a test scenario

    - The script completes and has some results from the run (data generated during the run) to return to the caller

    - More specifically, the output of some automated scripts is test data creation from calling web APIs we're testing. The request is to share this output to other tools/people so that the data can easily be consumed, e.g.:

     

    [Selenium UI Tests call] -> [Lisa-Invoke AppTest Script] -> [AppTest Script Completes] -> [Output returned to Selenium Test]

     

    One Lisa-Invoke param we use is StartTime that gets written to a MongoDB in a results collection, so the caller can generate this unique key and lookup results later itself, but it'd be great if the script could return something directly.



  • 2.  Re: Returning Data from Application Test Script

    Broadcom Employee
    Posted 08-30-2017 11:53 AM

    One suggestion would be to write the needed output to a data file which could then be read by other test cases.  When staging you should write the output file to a location outside of the Project so as not to get deleted when the test case has ended.



  • 3.  Re: Returning Data from Application Test Script

    Posted 08-30-2017 01:16 PM

    Thanks for the reply and suggestion Marcy. This is basically the idea behind my last paragraph where I mention writing values back to our MongoDB and storing w/ the run key (StartTime) that another caller could use to look up the data. I was just looking for a direct way to return data to a call, if possible.



  • 4.  Re: Returning Data from Application Test Script

    Broadcom Employee
    Posted 08-30-2017 01:42 PM

    I am not sure what version of DevTest you are on, but have you viewed the LISA-Invoke Documentation?:

     

    LISA Invoke - DevTest Solutions - 10.1 - CA Technologies Documentation 



  • 5.  Re: Returning Data from Application Test Script

    Posted 08-30-2017 01:55 PM

    Yes, I've reviewed the docs, but I don't see any way to return custom messages? Am I missing something? This is with 10.x



  • 6.  Re: Returning Data from Application Test Script

    Broadcom Employee
    Posted 08-30-2017 01:58 PM

    There are two sections:

    Invoke the Callback Service with LISA Invoke

    LISA Invoke Responses

     

    I for one have never done this, so not sure if it is something that could help you.



  • 7.  Re: Returning Data from Application Test Script

    Posted 08-30-2017 02:11 PM

    Correct, re: responses link, I reviewed them and I don't see a way to control what gets sent back like I'm seeking. This is a sample of what I get back, and reviewing the Response link in the docs and below, it doesn't look possible to return custom strings.

     

    <invokeResult>
    <method name="RunMar">
    <params>
    <param name="marOrMariPath" value="/apps/cmjenkins/workspace/servicetestframework/Tests/ServiceTestCommonScript.mar"/>
    <param name="callbackKey" value="AFCC5A825B8611E7AFDC0050568E34F4"/>
    </params>
    </method>
    <status>OK</status>
    <result>
    <status>ENDED</status>
    <reportUrl>
    <![CDATA[
    https://trnsvrt003.unix.gsm1900.org:1507/devtest/#/main/testMonitorTests/overview?testRunId=AFD227685B8611E7A6AD0050568E34F4
    ]]>
    </reportUrl>
    <runId>AFD227685B8611E7A6AD0050568E34F4</runId>
    <pass count="1"/>
    <fail count="0"/>
    <abort count="0"/>
    <warning count="0"/>
    <error count="0"/>
    <message>ServiceTestCommonScript,Run1User1Cycle</message>
    </result>
    </invokeResult>



  • 8.  Re: Returning Data from Application Test Script

    Broadcom Employee
    Posted 08-30-2017 02:27 PM

    Jason,

     

    Let me do some further research on this and find out just how the callbackKey is used.

     

    ~Marcy



  • 9.  Re: Returning Data from Application Test Script

    Posted 08-30-2017 03:00 PM

    Thanks Marcy. We use the callback key to check status (running, ended) right now. Looking forward to your feedback.



  • 10.  Re: Returning Data from Application Test Script

    Broadcom Employee
    Posted 09-05-2017 10:00 AM

    Jason,

     

    I do think the lisa-invoke can be use like you are asking.  This is the closest I came to seeing how it might be used:

     

    How to run Test Cases and Test Suites from LISA INVOKE 2.0.? 



  • 11.  Re: Returning Data from Application Test Script
    Best Answer

    Posted 09-05-2017 01:13 PM

    Thanks Marcy. I looked at the link, I don't see anything related to controlling data being returned by Lisa-invoke or the script it is calling, which is what I'm trying to do. We already are able to use Lisa-invoke to kick off scripts, but I'm trying to find a way to get a custom message back from the Lisa-invoke call so the caller can use data returned (not just a test result of pass/fail).

     

    It looks like I will have to write the results somewhere and then have the caller look them up.