1

在我使用 TestNG 和 Selenium 运行的测试中有一个结构示例:

<test>
      <classes>

          <class name="com.pou.MyTest">
                  <methods>
             // params here
             <include name="myMethodOne" />
          </methods>
          </class>

          <class name="com.pou.MyTest">
                  <methods>
             // params here
             <include name="myMethodTwo" />
          </methods>
          </class> 

      </classes>
</test>

运行此套件后,我收到一个错误:

org.testng.TestNGException:没有找到空闲节点:[DynamicGraph

有人告诉我这是由于一次调用相同的方法两次造成的

现在的问题是:我可以在一次测试中使用相同的课程两次吗?

我还要补充一点,由于某些原因,我需要在一个测试中使用它,所以将它分成两个不同的测试不是我需要的方法。

4

1 回答 1

-1

考虑改用 a @DataProvider,类只能在每个测试标签中出现一次。

于 2013-05-18T02:26:36.313 回答