0

I have a testNG.xml file having the code as mentioned below.This file is calling 2 other test suite files- Suite1 and Suite2. But I want to add some test cases to this file as well. Can I do this and if yes then how?

<parameter name="browser" value="firefox"></parameter>
<listeners>
    <listener class-name="org.uncommons.reportng.HTMLReporter" />
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners>

<suite-files>
    <suite-file path="./Suite1.xml" />
    <suite-file path="./Suite2.xml" />
</suite-files>

2 Answers 2

1

Check the DTD of the file in order to understand what you are allowed to do: http://testng.org/testng-1.0.dtd.php

In your case, you can add test cases without problem:

<parameter name="browser" value="firefox"></parameter>
<listeners>
    <listener class-name="org.uncommons.reportng.HTMLReporter" />
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners>

<suite-files>
    <suite-file path="./Suite1.xml" />
    <suite-file path="./Suite2.xml" />
</suite-files>

<test>
    <classes>
        <class>...</class>
        ...
    </classses>
    ...
<test>
-1

Add the file path in suite-file Like added Suite 1 and suite 2 added.

<suite-files>
    <suite-file path="./Suite1.xml" />
    <suite-file path="./Suite2.xml" />
    <suite-file path="./Suite3.xml" />
</suite-files>
1
  • This isn't really answering the question - the OP wants to add specific test cases as well as the test suites. If the only way to do this is to wrap the test cases in a separate test suite, please say so.
    – Kate Paulk
    Apr 13, 2017 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.