Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2023.2

...

The TestNG Executor tool enables you to execute TestNG tests in conjunction with the various other types of tests you can run with SOAtest. This enables allows you to design and execute a single test scenario that orchestrates TestNG tests as part of a broader sequence of events, such as setting up a test environment or test data, running unit tests via this tool, then executing mobile tests.

...

You can install this tool from the UI or from the command line.

UI Installation

  1. Choose Go to Parasoft> Preferences from the main menu.
  2. Choose the Syster Properties tab and click Add JARs.
  3. and click System Properties.
  4. Click Add JARs and choose the testngexecutor.jar file.
  5. Click Brows for the testngexecutor.jar file and click Apply.
  6. Restart SOAtest.

Command Line Installation

...

system.properties.classpath=<path to jar><PATH_TO_JAR>/testngexecutor.jar 

Usage

...

FieldDescriptionRequired
Jar or Class Folder

Specify the test's class folder or jar file. If you provide a jar/folder without specifying the Class or Method, TestNG will first look for a Suite XML file with the default name (testng.xml) and attempt to use that file to configure which tests to run. If that Suite XML file is not available and no classes or methods are specified, then the tool will run all of the tests in the jar/folder.

Required
ClassSpecify which TestNG class from the given jar or class folder to run.Optional
MethodSpecify which TestNG method to run. Leave this empty if you want to run all test methods in the specified class.Optional
Groups

Specify the group(s) of tests you want to run. TestNG supports annotating test methods with groups, allowing you to partition test methods into different logical groupings. For example, TestNG unit tests could be partitioned into “unit” and “integration” tests, or “smoke” and “functional” tests. This field takes either a single group or a comma-separated list of groups.

Refer to the TestNG documentation for more information: http://testng.org/doc/documentation-main.html#test-groups

Optional
Suite XML File

Specify the suite XML file(s) to run. Suite XML files (also called testng.xml files files by default) specify which packages, classes, suites and tests to be included or excluded, define new groups, specify dependencies, provide data parameters, and more.

Refer to the TestNG documentation for more information: http://testng.org/doc/documentation-main.html#testng-xml

Optional
Parameters

Specify semicolon-separated key/value pairs for parameters that you want passed to parameterized test methods. This is an alternative to configuring parameters in a suite XML file.

Refer to the TestNG documentation for more information: http://testng.org/doc/documentation-main.html#parameters

You could specify the first-name and last-name parameters as follows if your test contained the snippet below:

first-name=John;last-name=Doe 

Code Block
import static org.testng.AssertJUnit.*; 
import org.testng.annotations.*; 
public class DataTest { 
	@Parameters({ "first-name", "last-name" }) 
	@Test public void testData(String firstName, String lastName) {
 		assertEquals("John", firstName); 
		assertEquals("Doe", lastName); 
	} 
}
Optional
Command Line Arguments

Specify the TestNG command line options and arguments for any other TestNG options you want to apply. Provide the command line arguments in the same format as you would provide on the TestNG command line.

Refer to the TestNG documentation for more information: http://testng.org/doc/documentation-main.html#running-testng

Optional

...

The following examples demonstrate how to configure the tool for different scenarios.

Running a Specific Test Method

...

Code Block
Application.showMessage("this displays in the console");

  Add the com.parasoft.api.jar file located in the <SOATEST_INSTALL>/plugins/com.parasoft.ptest.libs.web_<version><VERSION>/root/com.parasoft.api.jar directory to your Java project classpath to import the resource.

...

  1. The TestNG test constructs a map containing the values.
  2. The map is placed into the application context.
  3. The values in the map will be converted into an XML document that is passed to any tools attached to the TestNG Output

...