Is it possible to return data from an application test script execution?
- 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.
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.
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.
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
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
There are two sections:
I for one have never done this, so not sure if it is something that could help you.
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>
Let me do some further research on this and find out just how the callbackKey is used.
Thanks Marcy. We use the callback key to check status (running, ended) right now. Looking forward to your feedback.
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.?
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.