IntelliJ cannot recognize the 'xml' File from Selenium Test with TestNG

I am using an IntelliJ ULTIMATE 14 in a MAC and I would like to develop a Selenium Test with TestNG. My Java class runs well. But when I create the

test.xml
file, IntelliJ does not recognize this. This means, when I click with right Button on the
test.xml
file I have not the Option to RUN the Test with the
test.xml
file.
I've been in Run/Debug Configurations and I've set up a new RUN Option:
  1. +
    TestNG
  2. Name: LoginTest
  3. Suite Option selected
  4. Suite:
    /PATH/PROJECT/src/test/resources/test.xml
  5. In single Module:
    /PATH/PROJECT/src/test/resources/test.xml
  6. JDK Settings / VM option:
    -ea



Below this window I get the following ERROR message:

Run Configuration Error: Unable to parse
`/PATH/PROJECT/src/test/resources/test.xml`

I have used too the Maven Dependency:

<dependency> 

 <groupId>org.testng</groupId> 

 <artifactId>testng</artifactId> 

 <version>6.8</version> 

</dependency>


Please someone has a tip?
7 comments
Comment actions Permalink

Hi,

from the error: bundled testng failed to parse your test.xml. Could you please share its content?

Thanks

0
Comment actions Permalink

The

test.xml
content is:

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Login Tests">

<test name="P1 Test">
    <groups>
        <run>
            <include name="p1" />
        </run>
    </groups>
    <classes>
        <class name="com.facebook.tests.LoginTest"/>
    </classes>
</test>

<test name="P2 Test">
    <groups>
        <run>
            <include name="p2" />
        </run>
    </groups>
    <classes>
        <class name="com.facebook.tests.LoginTest">
            <methods>
                <exclude name="filloutPassFld"/>
            </methods>
        </class>
    </classes>
</test>


</suite>
0
Comment actions Permalink

works fine here. Did you try to restart?

0
Comment actions Permalink

Yes I've tried re-start.
My IntelliJ does not recognize the

test.xml
file.
This means, when I click with right Button on the
test.xml
file, I have not the Option to RUN the Test with the
test.xml
file.

I've been in Run/Debug Configurations and I've set up a new RUN Option, but below this window I get the following ERROR message:

Run Configuration Error: Unable to parse
`/PATH/PROJECT/src/test/resources/test.xml`


when I run though XML file I get the following message:

org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 24; System-ID muss mit einem einzelnen oder doppelten Anführungszeichen beginnen.


at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:340)

at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88)

at ...

...

Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 24; System-ID muss mit einem einzelnen oder doppelten Anführungszeichen beginnen.


at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)

at ...

...
Process finished with exit code 0
0
Comment actions Permalink

Can you run this test.xml from command line? Because you've paste an internal testng error and IDEA can't influence this behaviour.

0
Comment actions Permalink

I found the problem. In

test.xml
file I forgot the quotes ("") in the command:

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

Thank you very much for listening.
0

Please sign in to leave a comment.