获取org.testng.TestNGException:在[DynamicGraph异常中找不到免费的节点 [英] Getting org.testng.TestNGException: No free nodes found in:[DynamicGraph Exception

查看:123
本文介绍了获取org.testng.TestNGException:在[DynamicGraph异常中找不到免费的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的testng.xml中多次编写同一个类.

例如,我在Login类中有两种方法login()logout().

I want to write same class more than once in my testng.xml.

for e.g i have two methods login() and logout() in Login class.

首先我要执行Login类的login()方法,然后执行OtherClass的method(),最后是Login类的logout()方法

First i want to execute Login class's login() method then OtherClass's method() and finally Login class's logout() method

<test name="scenario1">
   <classes>
      <class name="com.webaut.Login">
          <methods>
             <include name="login" />
           </methods>
       </class>

      <class name="com.webaut.OtherClass">
          <methods>
             <include name="method" />
           </methods>
       </class>


       <class name="com.webaut.Login">
           <methods>
              <include name="logout" />
           </methods>
       </class> 
   </classes>
</test>

执行完诉讼后,我得到一个"org.testng.TestNGException:在[DynamicGraph Exception"

After executing my suit i get an "org.testng.TestNGException: No free nodes found in:[DynamicGraph Exception"

我本可以使用@DataProvider,但是我的方法有所不同,所以请提出其他建议.

I could have used @DataProvider, but my methods are different so please suggest any alternative.

推荐答案

即使每个声明中包含不同的方法,每个类似乎只能在列表中声明一次,否则,您将看到此错误消息:(使用最新的TestNG 6.8.8,我可以使用@Test(priority =#)并在每种测试方法上具有特定的优先级,请参见

It appears that each class can only be declared once in the list, even if different methods are included on each declaration, otherwise you will see this error message :( Using latest TestNG 6.8.8. I was able to get this to work with @Test(priority=#) with the specific priority on each test method. See http://testng.org/doc/documentation-main.html#annotations.

我的用例:对实体进行原始测试.每个实体都有其自己的带有4种方法的测试类(因​​此,我只能隔离地测试单个实体CRUD),但我也想运行整个套件(由于完整性约束和生成的ID密钥不同,除非它们在以下位置运行,否则将失败)完全正确的顺序).

My use case: crud tests for entities. Each Entity has its own test class with 4 methods (so I can test only a single entity CRUD in isolation), but I also want to run the overall suite (will fail due to integrity constraints and different generated ID keys unless they are run in exactly the right order).

org.testng.TestNGException中提出了相同的问题可以在[DynamicGraph .

这篇关于获取org.testng.TestNGException:在[DynamicGraph异常中找不到免费的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆