Service Virtualization

Expand all | Collapse all

how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

Jump to Best Answer
  • 1.  how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 08-09-2016 11:47 PM

    I want to be able to run a lisa test (present on my system) by staging it on a remote server(where the reg, coor, sim are running) from eclipse.

    How can I achieve that? TestRunner perhaps?

    How can I invoke the test runner from within the java code in eclipse?

     

    Thanks!

    Amruta



  • 2.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 08-09-2016 11:58 PM

    TestRunner should work.  How about something like this:

     

    public class TestRunner {
      
    public static void main(String[] args) throws Exception {

      
    String[] cmd = { "C:\\DevTest\\bin\\TestRunner.exe", "-u username", "-p password", "-m TestRegistryName", "-t multi-tier-combo.tst", "-a" };
      
    Process p = Runtime.getRuntime().exec(cmd);
       p
    .waitFor();
      
    }
    }

     

    Run a Test Case with Test Runner - DevTest Solutions - 9.5 - CA Technologies Documentation

     

    Josh



  • 3.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 12-13-2016 04:24 AM

    Hi Josh,

     

    I have a requirement to invoke my devtest testcase in  middle of my java scripts. I tried to use the above code.

    Can you please let me know how can i get the response that the test is executed or passed?

     

    Requirement2:

     

    I have a bunch of testsuites. I need to trigger it with some batch job or some scheduler. How to achieve this.

     

    Please help me in the above both 2 queries.

     

    Thanks & Regards,

    Mohan



  • 4.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 12-13-2016 09:38 AM

    Hi Josh,

     

    My testrunner command is working fine in command prompt. But when I try to do the same with java code getting the error as Unknown Option. PFB the error. I am also getting the same error for -u -p even if i change my order of the parameters.

     

    RETURN CODES:
    0 : all tests passed
    1..n : n tests failed (up to a max of 250)
    253 : License failure
    254 : No TestRegistry found
    255 : Bad parameters

    EXAMPLES:
    Run the multi-tier-combo test with the default 1-user, 1-time staging document:
    TestRunner -t LISA_HOME/examples/Tests/multi-tier-combo.tst

    Run the suite AllTestsSuite locally:
    TestRunner -s LISA_HOME/examples/Suites/AllTestsSuite.ste

    Run the suite AllTestsSuite on a TestRegistry running on another machine (the registry will assign a coord server):
    TestRunner -s LISA_HOME/examples/Suites/AllTestsSuite.ste -m somemachine/Registry
    Exiting with exit code 255 (INTERNAL ERROR)
    Here is the standard error of the command (if any):


    unknown option: -t C:/KPN_GIT/test-automation/Tests/test_2.tst



  • 5.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 12-15-2016 08:19 PM

    Can you paste the Java code that you're using?



  • 6.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 08-10-2016 02:04 AM

    Thank you Josh,

     

    Is there any other way? Am looking for something for which I don't need Lisa to be installed on my system.

    Importing some lisa jars into eclipse is fine. The solution needs to be portable as an eclipse project.

    Is there a way to get testrunner as a jar and execute it?

     

    Thanks!

    Amruta



  • 7.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?
    Best Answer

    Posted 08-10-2016 09:21 AM


  • 8.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 08-10-2016 10:11 PM

    Thanks Josh,

     

    I gave this a try and I am able to stage the test on a remote server.

    The issue I am facing is that there is no information in lisa-invoke response about why a test failed. It just has number of pass/failures.

     

    I started to write a java snippet in eclipse to trigger the testrunner through code using executeTestRunnerPlugin. It's still not able to run the test, am not sure what i am doing wrong here. Would you be able to guide here?

    Here is a my java snippet----

     

    import com.itko.lisa.coordinator.*;

     

    TestRunnerConfiguration Config1 = new TestRunnerConfiguration();

        Config1.setTestRegistryName("tcp://***:2010/Registry");

        Config1.setCoordinatorServerName("tcp://***:2011/Coordinator");

        Config1.setHtmlReportPath("C:\\***\\myreport.html");

        Config1.setStagingDocument("C:\\***\\Run1User1Cycle.stg");

        Config1.setUser("***");

        Config1.setPassword("***");

        Config1.setAutoStart(true);

        Config1.setConfigFile("C:\\***.config");

        Config1.setTestDocument("C:\\***.tst");

        int status = com.itko.lisa.coordinator.TestRunner.executeTestRunnerPlugin(Config1, null);

        System.out.println("status is:::" + status);

     

    I can see that the status returned is 0, but the test does not get executed.

     

    Thank you,

    Amruta



  • 9.  Re: how to execute a lisa test from eclipse? How can I invoke testRunner from eclipse?

    Posted 08-10-2016 11:16 PM

    I'm not sure if you've tried this or if it meets your needs, but you can pull back the report URL using this API call:

     

    https://support.ca.com/cadocs/0/CA%20DevTest%20Solutions%208%200-ENU/Bookshelf_Files/Invoke/index.html#1394905159

     

    As to why the code you wrote isn't working, I'm not sure off the top of my head unfortunately as I haven't used these classes myself.  You also may want to create an idea on the ideas page for the reporting information to be in the API response in the future.