We know the configuration file of testng, there can only be one suite in an .xml, so what if you want to set up multiple suites? At this time we need to use the testng tag
Let’s talk about an example I made. First, I have two suites, one is UItest.xml and the other is APITest.xml. The code is as follows:
UITest.xml:
<class name="testcase.CheckLink">class>
APITest.xml:
<class name="APITestcase.CheckWeather">class>
At this time, I also talk about the detours I have taken. My project uses maven, and maven uses
src/test/resources/testng.xml
Initially I thought that as long as one more
Let’s get back to the point. Finally, for the sake of brevity of the code, I also use a testng.xml to integrate APITest.xml and UITest.xml, as shown in the following figure:
Then just associate testng.xml in maven, and the final execution result is shown in the figure below:
<class name="testcase.CheckLink">class>
<class name="APITestcase.CheckWeather">class>
src/test/resources/testng.xml