testng - access a class file from local path to java code -


I am trying to execute the testcode test case with the Java code, so I got the code from testng.

  test listener adapter tla = new test listener adapter (); TestNG testng = New TestNG (); Testng.setTestClasses (new square [] {Run2.class}); Testng.addListener (TLA); Testng.run ();  

Now I want to provide the class (i.e. Run 2) file from the local path.

I do not want to keep this category in my existing package

Please tell me how to get one from the local class to the Java class. Class file is to be accessed so that it will run testgate taxcases from any location where the class is present.

with a URL of the folder try to use. And then use loadClass (classname) to load the class.


Comments