Service Virtualization

Expand all | Collapse all

How to trigger the devtest testcases from java. Also how to schedule the same.

Jump to Best Answer
  • 1.  How to trigger the devtest testcases from java. Also how to schedule the same.

    Posted 12-06-2016 06:43 AM

    Hi All,

     

    Please provide some inputs in triggering the devtest testcases from java code. Also some details on scheduling and integrating the testcases with Jenkins.

     

    Thanks in advance.

     

    Regards,

    mohan



  • 2.  Re: How to trigger the devtest testcases from java. Also how to schedule the same.
    Best Answer

    Posted 12-06-2016 08:09 AM

    My suggestion would be that you consider using the REST interface to launch tests rather than build Java code to launch internal DevTest components.  The REST interface provides a wrapper that protects you from internal changes that can be made to the product without notice.  Jenkins should also be able to utilize the REST interface.

     

    https://docops.ca.com/devtest-solutions/10-0/en/using/using-ca-application-test/using-devtest-workstation-with-ca-applic…    



  • 3.  Re: How to trigger the devtest testcases from java. Also how to schedule the same.

    Posted 12-06-2016 09:43 AM

    Hi joel,

     

    Thanks for your help. The link is forbidden for me. (403).

    I am running my GUI testcases in selenium webdriver. After some particular time, I need to trigger my DevTest testcases. This is my requirement here.

    It would be very helpfull, If you provide some more insights in this.

     

    Thanks in advance.

     

    Regards,

    Mohan



  • 4.  Re: How to trigger the devtest testcases from java. Also how to schedule the same.

    Posted 12-06-2016 09:56 AM

    The invoke API may also be documented in the Use's Guide document if you have a local copy.  The idea is to invoke the API using something like CURL.  You will need to include the appropriate user ID / password.

    Following is an excerpt from the doco:

    /lisa-invoke/runTest?testCasePath=testCasePath&stagingDocPath=stagingDocPath&[configPath=configPath]&[async=true]&[coordName=csName]&[-D<CustomTag>=x]
    The parameters are:

    testCasePath   - The path to the test case to invoke.
    stagingDocPath - The path to the staging document. If not provided, a default staging document is created.
    configPath     - The path to the configuration. If not provided, the project.config file for the project is used.
    async          - If true, then the response includes a callback key. If not provided, the parameter is set to false.
    coordName      - The path to the coordinator. If not provided, the default coordinator name is used.
    -D<CustomTag>  - Defines any custom tag to any value. For example: &[-DVersion=1.5.3]

     

    Example Synch Execution of a test:
    http://localhost:1505/lisa-invoke/runTest?testCasePath=examples/Tests/AccountControlMDB.tst&stagingDocPath=examples/StagingDocs/1user1cycle0think.stg

    Response XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <invokeResult>
    <method name="RunTest">
    <params>
    <param name="stagingDocPath" value="examples/StagingDocs/1user1cycle0think.stg" />
    <param name="coordName" value="Coordinator" />
    <param name="configPath" value="" />
    <param name="testCasePath" value="examples/Tests/AccountControlMDB.tst" />
    <param name="callbackKey" value="64343533653737312D343765312D3439" />
    </params>
    </method>
    <status>OK</status>
    <result>
    <status>ENDED</status>
    <reportUrl><![CDATA[htp://localhost:1505/index.html?lisaPortal=reporting/printPreview_functional.html#Idstr=61653261643936342D613636392D3435&curtstr=T]]></reportUrl>
    <runId>61653261643936342D613636392D3435</runId>
    <pass count="1" />
    <fail count="0" />
    <warning count="0" />
    <error count="0" />
    <message>AccountControlMDB,Run1User1Cycle0Think</message>
    </result>
    </invokeResult>

     

    Example Asynch Execution of a Test Case:
    http://localhost:1505/lisa-invoke/runTest?testCasePath=examples/Tests/AccountControlMDB.tst&stagingDocPath=examples/StagingDocs/1user1cycle0think.stg&async=true

    Response XML with Callback Key:
    <?xml version="1.0" encoding="UTF-8"?>
    <invokeResult>
    <method name="RunTest">
    <params>
    <param name="stagingDocPath" value="examples/StagingDocs/1user1cycle0think.stg" />
    <param name="coordName" value="" />
    <param name="configPath" value="" />
    <param name="testCasePath" value="examples/Tests/AccountControlMDB.tst" />
    <param name="callbackKey" value="61663038653562382D663566372D3432" />
    <param name="async" value="true" />
    </params>
    </method>
    <status>OK</status>
    <result>
    <callbackKey>61663038653562382D663566372D3432</callbackKey>
    <message>The LISA test 'examples/Tests/AccountControlMDB.tst' was launched asynchronously at Mon Mar 26 16:05:39 PDT 2012.</message>
    </result>
    </invokeResult>