0% found this document useful (0 votes)
30 views2 pages

Excecutable Document

The document discusses how to create a JAR file containing TestNG classes and how to run TestNG tests from the command line by specifying the test class, test names, listener classes, and an XML configuration file; it also lists available command line parameters for TestNG including options for the test class, suite name, test names, methods, reporters, and listeners.

Uploaded by

Thanneru Hemadri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Excecutable Document

The document discusses how to create a JAR file containing TestNG classes and how to run TestNG tests from the command line by specifying the test class, test names, listener classes, and an XML configuration file; it also lists available command line parameters for TestNG including options for the test class, suite name, test names, methods, reporters, and listeners.

Uploaded by

Thanneru Hemadri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXCECUTABLE DOCUMENT

1.Create a Jar using project class Automation.class and non project class org.testng.TestNG
jar -cvf ask_community_api.jar automation.class

2. Assuming that you have TestNG in your class path, the simplest way to invoke TestNG is as follows
java org.testng.TestNG testng.xml

You need to specify at least one XML file describing the TestNG suite you are trying to run. Additionally, the following command-line switches are available:

Command Line Parameters Option testcla ss suiten ame Argument A comma-separated list of classes that can be found in your classpath. The default name to use for a test suite. Documentation A list of class files separated by commas (e.g. "org.foo.Test1,org.foo.test2"). This specifies the suite name for a test suite defined on the command line. This option is ignored if the suite.xml file or the source code specifies a different suite name. It is possible to create a suite name with spaces in it if you surround it with double-quotes "like this". This specifies the name for a test defined on the command line. This option is ignored if the suite.xml file or the source code specifies a different test name. It is possible to create a test name with spaces in it if you surround it with double-quotes "like this". Lets you specify individual methods to run.

testna me

The default name to use for a test.

metho ds

A comma separated list of fully qualified class name and method. For example
com.example.Foo.f1,com.ex ample.Bar.f2.

report er

The extended configuration for a custom report listener.

Similar to the -listener option, except that it allows the configuration of JavaBeans-style properties on the reporter instance. Example: -reporter
com.test.MyReporter:methodFilter=*insert*, enableFiltering=true

You can have as many occurences of this option, one for each reporter that needs to be added.

listene r

A comma-separated list of Java classes that can be found on your classpath.

Lets you specify your own test listeners. The classes need to extends org.testng.TestListenerAdapter

3.To run the test class:


java org.testng.TestNG -testclass org.test.MyTest

You might also like