No free nodes found in:[DynamicGraph error when each test has group-by-instance set to true.

714 views
Skip to first unread message

SPS

unread,
Aug 21, 2016, 1:55:39 PM8/21/16
to testng-users
Hello
I have 3 test classes in a suite. Each test class has multiple data row.so I using factory method with group-by-instance="true"
when I try to run the suite with three test class

it gives No free nodes found in:[DynamicGraph error

If I create three individual  suites with one test class per suite .it works fine. As suggested on some post I set

setPreserveOrder("False") which bypassed the error but each data row ran twice.


Please suggest some solution.


Thanks


Krishnan Mahadevan

unread,
Aug 21, 2016, 1:57:59 PM8/21/16
to testng-users

You would need to show us :

1. Your test code.
2. Your suite xml.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

SPS

unread,
Aug 22, 2016, 9:45:46 AM8/22/16
to testng-users
We build the xml dynamically, in this situation it unable to build it. It throws exception

org.testng.TestNGException:

No free nodes found in:[DynamicGraph



Krishnan Mahadevan

unread,
Aug 22, 2016, 9:48:50 AM8/22/16
to testng-users

That still doesn't help. If you are generating the xml dynamically you should still be able to print it out on the console no ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/




SPS

unread,
Aug 23, 2016, 8:29:33 AM8/23/16
to testng-users
Here is my xml and tests

public class Test1
{
        @Factory(dataProvider = "getData", dataProviderClass = DataProvider.class)
       public static Object[] createInstances(Hashtable<String, String> data)
 {
      return new Object[]
     { new Test1(data) };
 }

 public Test1(Hashtable<String, String> data)
 {
 
        }
 public void method1(){
 }

}

##########################
public class Test2
{
        @Factory(dataProvider = "getData", dataProviderClass = DataProvider.class)
 public static Object[] createInstances(Hashtable<String, String> data)
 {
      return new Object[]
     { new Test2(data) };
 }

 public Test2(Hashtable<String, String> data)
 {
 
        }
 public void method1(){
 }

}

#################################

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite thread-count="0" verbose="5" name="ABC Tests" data-provider-thread-count="0" group-by-instances="true">

<parameter name="EnvironmentURL" value="https://abc.com/"/>

<listeners>

<listener class-name="ABCListener"/>

</listeners>

<test thread-count="0" verbose="0" name="Test1" time-out="0">

<parameter name="SheetName" value="QAZ"/>

<parameter name="FileName" value="\\ABC.xlsx"/>

<classes>

<class name="Test1">

</class>

</classes>

</test>

<test thread-count="0" verbose="0" name="Test2 " time-out="0">

<parameter name="SheetName" value="QAZ"/>

<parameter name="FileName" value="\\ABC.xlsx"/>

<classes>

<class name="Test2">

</class>

</classes>

</test>

</suite>





On Sunday, August 21, 2016 at 12:55:39 PM UTC-5, SPS wrote:

SPS

unread,
Aug 23, 2016, 9:37:54 AM8/23/16
to testng-users


On Sunday, August 21, 2016 at 12:55:39 PM UTC-5, SPS wrote:

SPS

unread,
Aug 25, 2016, 5:06:45 AM8/25/16
to testng-users
Can somebody help me on this issue , please?


On Sunday, August 21, 2016 at 12:55:39 PM UTC-5, SPS wrote:

⇜Krishnan Mahadevan⇝

unread,
Aug 25, 2016, 11:35:50 PM8/25/16
to testng...@googlegroups.com
Sneha,

I am not able to recreate your problem. So you would need to share a complete working sample which can be executed to recreate the problem. You can stub out the business logic and replace it with sysouts.

Here's the sample that I tried :

package organized.chaos.forums.testng;

import org.testng.Assert;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;

import java.util.Map;

public class TestClass1 {
@Factory (dataProvider = "getData", dataProviderClass = LocalDataProvider.class)
public static Object[] createInstances(Map<String, String> data) {
return new Object[] {
new TestClass1(data)
};
}

private Map<String, String> map;

public TestClass1(Map<String, String> data) {
this.map = data;
System.err.println("Instantiating " + getClass().getName() + " on thread " + threadId());

}

private long threadId() {
return Thread.currentThread().getId();
}

@Test
public void method1() {
Assert.assertFalse(this.map.isEmpty());
String method = getClass().getName() + "." + new Object(){}.getClass().getEnclosingMethod().getName() + "() ";
System.err.println("Executing " + method + " on thread " + threadId());
}


@Test
public void method2() {
Assert.assertFalse(this.map.isEmpty());
String method = getClass().getName() + "." + new Object(){}.getClass().getEnclosingMethod().getName() + "() ";
System.err.println("Executing " + method + " on thread " + threadId());
}

}
package organized.chaos.forums.testng;

import org.testng.Assert;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;

import java.util.Map;

public class TestClass2 {
@Factory (dataProvider = "getData", dataProviderClass = LocalDataProvider.class)
public static Object[] createInstances(Map<String, String> data) {
return new Object[] {
new TestClass2(data)
};
}

private Map<String, String> map;

public TestClass2(Map<String, String> data) {
this.map = data;
System.err.println("Instantiating " + getClass().getName() + " on thread " + threadId());
}

private long threadId() {
return Thread.currentThread().getId();
}


@Test
public void method1() {
Assert.assertFalse(this.map.isEmpty());
String method = getClass().getName() + "." + new Object() {
}.getClass().getEnclosingMethod().getName() + "() ";
System.err.println("Executing " + method + " on thread " + threadId());

}

@Test
public void method2() {
Assert.assertFalse(this.map.isEmpty());
String method = getClass().getName() + "." + new Object() {
}.getClass().getEnclosingMethod().getName() + "() ";
System.err.println("Executing " + method + " on thread " + threadId());

}

}

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="5" verbose="5" name="ABC Tests" data-provider-thread-count="0" group-by-instances="true"
parallel="tests">

<test thread-count="0" verbose="0" name="Test1" time-out="0">
        <classes>
<class name="organized.chaos.forums.testng.TestClass1"/>

</classes>
</test>

<test thread-count="0" verbose="0" name="Test2 " time-out="0">
        <classes>
<class name="organized.chaos.forums.testng.TestClass2"/>
</classes>
</test>
</suite>








Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.

SPS

unread,
Aug 29, 2016, 5:57:54 AM8/29/16
to testng-users
Thanks Krishnan. The problem is solved. Had an issue while building testing.xml.
On Sunday, August 21, 2016 at 12:55:39 PM UTC-5, SPS wrote:

shrey chaturvedi

unread,
Jun 8, 2017, 8:05:28 AM6/8/17
to testng-users
Hi,

Can you tell me how did you solved this issue? I am also facing this same issue...

Can somebody help?

Krishnan Mahadevan

unread,
Jun 8, 2017, 12:20:54 PM6/8/17
to testng...@googlegroups.com

Shrey,

 

Can you please help share your suite xml file that is causing the problem for you ?

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--

You received this message because you are subscribed to the Google Groups "testng-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.

Shruti Narasimhan

unread,
Jul 19, 2018, 9:08:38 AM7/19/18
to testng-users
Hi,
I had the same issue, I resolved it by adding parallel = "true", below is the code.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Sanity Testing" parallel="true">
  <test name="VerifyTitles">
    <classes>
      <class name="WebDriver.VerifyTitles"/>
      <class name="WebDriver.VerifyTitles2"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->
 
please try this if it works
Reply all
Reply to author
Forward
0 new messages