using Preserve-order="true", Selenium webdriver and surefireplugin occours error

125 views
Skip to first unread message

sabf

unread,
Sep 28, 2011, 9:55:23 AM9/28/11
to testng...@googlegroups.com
When i try to execute my tests an add the preserve-order="true" in my test i got that error:

org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Caused by: java.lang.NullPointerException
    at org.testng.TestRunner.createClassDependencies(TestRunner.java:1182)
    at org.testng.TestRunner.createDynamicGraph(TestRunner.java:1079)
    at org.testng.TestRunner.privateRun(TestRunner.java:725)
    at org.testng.TestRunner.run(TestRunner.java:614)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:335)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
    at org.testng.SuiteRunner.run(SuiteRunner.java:241)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
    at org.testng.TestNG.run(TestNG.java:1006)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:122)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:101)
    ... 9 more

I hope somebody can help me to solve that problem.

testng.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Portal Test Suite" parallel="classes" thread-count="5" verbose="10" >
   <!-- <listeners>
        <listener class-name="org.uncommons.reportng.HTMLReporter" />
    </listeners> -->
    <test name="Portal Suite Firefox on Windows" preserve-order="true">
        <parameter name="browser" value="Firefox on Windows"/>
        <parameter name="browserpath" value="C:\\work\\FireFox\\firefox.exe"/>
        <!-- <parameter name="browserpath" value="C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"/> -->
        <classes>
        <!--    <groups>
                <run> -->
                   <!-- <include name ="testnow"/> -->
            <!--        <include name ="smoketest.de"/>
                    <include name ="smoketest.en"/>
                    <include name ="smoketest.pl"/>
                </run>
            </groups> -->
            <class name="de.x.portal.registration.RegistrationTest"/>
            <class name="de.x.portal.payment.PaymentTest"/>
            <class name="de.x.portal.other.OtherTest"/>
            <class name="de.x.portal.myprofile.PersonalDataTest"/>
            <class name="de.x.portal.bonus.BonusTests"/>
        </classes>
    </test>
</suite>

pom.xml

Joe Snikeris

unread,
Sep 28, 2011, 10:46:44 AM9/28/11
to testng...@googlegroups.com
On Wed, Sep 28, 2011 at 9:55 AM, sabf <s.a...@gmx.de> wrote:
> When i try to execute my tests an add the preserve-order="true" in my test i
> got that error:
>
> Caused by: java.lang.NullPointerException
>     at org.testng.TestRunner.createClassDependencies(TestRunner.java:1182)

Here is a small project that reproduces this issue:
https://github.com/jsnikeris/testng-sandbox

Cédric Beust ♔

unread,
Sep 28, 2011, 11:36:04 AM9/28/11
to testng...@googlegroups.com, j...@snikeris.com
Hi Joe,

Thanks for supplying a test case, it makes my life easier.

However, it's passing for me:

PASSED: testOne

===============================================
    Tests
    Tests run: 1, Failures: 0, Skips: 0
===============================================

Can you try the beta at http://testng.org/beta?

-- 
Cédric





--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


Message has been deleted

sabf

unread,
Sep 29, 2011, 1:51:17 AM9/29/11
to testng...@googlegroups.com, j...@snikeris.com
Hi,

i now use testng 6.2.1 and it seems to work....wait a moment tests are running....yes it works.

thanks,
sabf

Cédric Beust ♔

unread,
Sep 29, 2011, 2:20:59 AM9/29/11
to testng...@googlegroups.com, j...@snikeris.com
I usually don't upload it to the SNAPSHOT repository, but what you can do is download the beta .jar and reference it in your pom.xml dependency as <systemPath>.


-- 
Cédric




On Wed, Sep 28, 2011 at 10:47 PM, sabf <s.a...@gmx.de> wrote:
Hi Cedric,

is there a maven repository for the beta-version?

thanks,
sabf

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/LEUmhdKMt4oJ.
Reply all
Reply to author
Forward
0 new messages