1
XmlSuite suite = new XmlSuite();
suite.setName("RegSuite");
XmlTest test = new XmlTest(suite);
test.setName("MyTest");
List<XmlClass> classes = new ArrayList<XmlClass>();
classes.add(new XmlClass("tests.test1"));
test.setXmlClasses(classes) ;
List<XmlSuite> suites = new ArrayList<XmlSuite>();
suites.add(suite);
TestNG tng = new TestNG();
tng.setXmlSuites(suites);
tng.run();

@test1
public void test1(){

    try{
        ModifiableSDKConfiguration config = new ModifiableSDKConfiguration();
        config.setServerAddress(new URI("ws://myServerAddress:5095"));
        SDK.init(config);
        Reporter.init();

       Browser OBrowser = BrowserFactory.Launch(BrowserType.InternetExplorer);
      Console.WriteLine("Navigating to Google.com");
      OBrowser.Navigate("Google.com");
      OBrowser.Sync();
      Reporter.ReportEvent("Browser Sync", "Browser sync completed", HP.LFT.Report.Status.Passed);
      OBrowser.Close();

      //test code

      Console.WriteLine("Generatig reports and closing SDK");

      //Generate the report and cleanup the SDK usage.
      Reporter.generateReport();
      SDK.cleanup();
    } catch(Exception e){
    }
}

In above scenario my report is generated and everything is working fine , but the only thing is that JVM never terminated and waits forever. Please help me here. Also I tried adding the @beforeclass and @afterclass method to teardown the test and testsuite but no luck , same thing if tried to run from the Testng.XML file it works fine but I wanted to generate the xml runtime as this is my framework requirement

vinS
  • 1,417
  • 5
  • 24
  • 37
  • 1. How do you run the test? 2. How do you know that JVM is never terminated? – Adelin Dec 12 '17 at 07:30
  • I am running the it as java main application by putting the virtual testing xml in the Main method which in turn calls the test & executes it properly, but after executing the test , Eclipse console is not showing the terminated text & I need to click on the Red stop button to stop and clear the execution – Sumit Bhatnagar Dec 12 '17 at 07:39
  • @SumitBhatnagar - Can you please help create a test project which we can execute to reproduce the issue ? If its a full fledged standalone project (including details about dependencies are needed etc.,) it would be great. – Krishnan Mahadevan Dec 13 '17 at 17:00
  • @KrishnanMahadevan - sure will send you the git link for the same so that you can reproduce the issue – Sumit Bhatnagar Dec 14 '17 at 06:43
  • @SumitBhatnagar do you have the git link? – Adelin Jan 31 '18 at 06:39
  • @SumitBhatnagar: same issue. Did you find any solution? – Shiridish Apr 02 '18 at 12:06

0 Answers0