classes = new Ar" /> classes = new Ar" /> classes = new Ar"/>

LeanFT not destroying the JVM after execution is complete

194 views Asked by At
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

0

There are 0 answers