I created a simple struts application, according the user input it calls the action method and in turn it calls testNG.run ()

The tests are executed just fine but the reports are not updated with the new result neither the reportNG.

The same methods when through main method the reports are generated just fine. Any suggestions why this is happening or how to achieve this scenario?


More Details:
1. I am using TestNG, ReportNG, and struts actions to take user inputs.
2. using struts I created a jsp with form action: executeTest1
3. when submitted/clicked it calls a method in the action class.
4. In action class that extends ActionSupport,

public String addMemo() {
            TestListenerAdapter tla = new TestListenerAdapter();            
            TestNG testng = new TestNG();
            List<String> suites = Lists.newArrayList();
            suites.add("path-to-Suite1.xml");
            testng.setTestSuites(suites);
            testng.addListener(tla);
            testng.run();
            System.out.println(" -- Done.");

        return SUCCESS;     
    }
  1. the tests run successfully, but the reportNG is not generated, neithere the testNG reports.
0

There are 0 best solutions below