Jai P
2011-06-27 20:44:29 UTC
If I have two classes as part of my test in the suite, BeforeSuite
runs only the second one and gives NullPointerException for all tests
in the first test class despite specifying preserve-order="true"
I have the following testng.xml
<test name="ReportingTests" preserve-order="true">
<classes>
<class name="com.blah.ReportRunTests">
<methods>
<include name="login" />
<include name="checkHomeTab" />
<include name="checkReportsTab" />
<include name="checkReportsExist" />
<include name="reportsCleanup" />
</methods>
</class>
<class name="com.blah.ActivityTests">
<methods>
<include name="login" />
<include name="checkHomeTab" />
<include name="checkReportsTab" />
<include name="checkReportsExist" />
<include name="expandReportsTabAndClickActivity" />
</methods>
</class>
</classes>
My Test class has this:
@Parameters({ "webconsoleStartupURL" })
@BeforeSuite(description = "Perform class setup tasks")
public void beforeClass(final String webconsoleStartupURL)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException {
sm = new SeleniumMgr(webconsoleStartupURL);
sm.startSelenium();
}
@AfterSuite(description = "Perform class teardown tasks")
public void afterClass() {
sm.stopSelenium();
}
When i execute the tests, only the second test in the xml,
i.e.ActivityTests seems to run and then it exits the suite. The first
class in not executed and I see NullPointerException for each of the
tests in the first.
I want only one instance of the browser and have multiple tests
executed. The testng doc suggests the xml version I have used above is
in fact correct. What is wrong here?
runs only the second one and gives NullPointerException for all tests
in the first test class despite specifying preserve-order="true"
I have the following testng.xml
<test name="ReportingTests" preserve-order="true">
<classes>
<class name="com.blah.ReportRunTests">
<methods>
<include name="login" />
<include name="checkHomeTab" />
<include name="checkReportsTab" />
<include name="checkReportsExist" />
<include name="reportsCleanup" />
</methods>
</class>
<class name="com.blah.ActivityTests">
<methods>
<include name="login" />
<include name="checkHomeTab" />
<include name="checkReportsTab" />
<include name="checkReportsExist" />
<include name="expandReportsTabAndClickActivity" />
</methods>
</class>
</classes>
My Test class has this:
@Parameters({ "webconsoleStartupURL" })
@BeforeSuite(description = "Perform class setup tasks")
public void beforeClass(final String webconsoleStartupURL)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException {
sm = new SeleniumMgr(webconsoleStartupURL);
sm.startSelenium();
}
@AfterSuite(description = "Perform class teardown tasks")
public void afterClass() {
sm.stopSelenium();
}
When i execute the tests, only the second test in the xml,
i.e.ActivityTests seems to run and then it exits the suite. The first
class in not executed and I see NullPointerException for each of the
tests in the first.
I want only one instance of the browser and have multiple tests
executed. The testng doc suggests the xml version I have used above is
in fact correct. What is wrong here?
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to testng-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to testng-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.