TestNG file execution Along with jar file.
1. Create a main class 1st
package Testcase;
import com.beust.testng.TestNG;
@SuppressWarnings("deprecation")
public class MainOne {
public static void main(String[] args) {
TestNG testng = new TestNG();
Class[] classes = new Class[]{houpad.class}; //houpad is the class where i included all the //testNG executable testcases.
testng.setTestClasses(classes);
testng.run();
}
}
To export a jar file
1. Run the main class then
2. Right click on the package name> Export> Java> rurnnable JAR file> from the launch configuration select the main class created above.> Hit finish.
3. Now double click on the jar file
4. It will show the execution
http://testng.org/doc/documentation-main.html#running-testng-programmatically
1. Create a main class 1st
package Testcase;
import com.beust.testng.TestNG;
@SuppressWarnings("deprecation")
public class MainOne {
public static void main(String[] args) {
TestNG testng = new TestNG();
Class[] classes = new Class[]{houpad.class}; //houpad is the class where i included all the //testNG executable testcases.
testng.setTestClasses(classes);
testng.run();
}
}
To export a jar file
1. Run the main class then
2. Right click on the package name> Export> Java> rurnnable JAR file> from the launch configuration select the main class created above.> Hit finish.
3. Now double click on the jar file
4. It will show the execution
http://testng.org/doc/documentation-main.html#running-testng-programmatically
No comments:
Post a Comment