我想通过代码动态创建 testng.xml 文件。
下面的 Sample testng.xml 文件需要通过代码创建。
使用下面的代码,我可以创建套件、测试和添加类文件。但我无法使用包含标签添加方法。
**XmlSuite suite = new XmlSuite();
//below line is to add suite
suite.setName("FirstTest");
//below line is to set methods in parallel
suite.setParallel(XmlSuite.ParallelMode.METHODS);
//below line is to set the threadcount
suite.setThreadCount(5);
XmlTest test = new XmlTest();
test.setName("ChromeTest");
XmlClass classname = new XmlClass("test2.MainTest1");
List<XmlClass> list = new ArrayList<XmlClass>();
list.add(classname);**
请帮我生成如下所示的 testng.xml 以添加方法。我可以上课,但我无法添加方法。请帮我生成 testng.xml 如上所示