Test parameters in TestListener

How can I access test parameters in TestListener (which is attached via init script)? This is needed for tests that use TestNG’s DataProvider

If you need access to test parameters, you’ll have to do it on the test (JVM) side. For example, you can register a TestNG listener with ‘test.useTestNG { listeners << “my.org.testng.ITestListener” }’.

Any chances this information is added to TestDescriptor passed to TestListener? Having to attach some test-ng-specific listeners is not a good solution for Gradle-TeamCity integration :slight_smile:

Do you need the original values, or some String representation? If you need the values, we’d have to serialize them and send them over to the Gradle JVM, which could cause problems.

At current state, string representation would be sufficient. It will give CI server users a good hint and will allow TeamCity to distinguish tests failures with different parameters.