I have two xml files to run tests - api.xml and ui.xml
In ui.xml I have TestNG Listener, but this Listener also is applied when API tests run.
I run tests using testng.xml
ui.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="UI">
<listeners>
<listener class-name="utils.Listeners.DebugUiListener"/>
</listeners>
<parameter name="environment" value="qa"/>
<test name="Login and SignUp">
<classes>
<class name="utils.Settings" />
<class name="UiTests.UILoginTest"/>
</classes>
</test>
</suite>
api.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="API">
<parameter name="environment" value="qa"/>
<test name="Login and SignUp">
<classes>
<class name="utils.Settings" />
<class name="ApiTests.ApiLoginTest" />
</classes>
</test>
</suite>
testng.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite">
<suite-files>
<suite-file path="ui.xml" />
<suite-file path="api.xml"/>
</suite-files>
</suite>
DebugUiListener
public class DebugUiListener implements ITestListener {
//some code
}
What could be the problem?