question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

org.testng.xml.Parser chokes on file: URI reference

See original GitHub issue

If the test suite definition file is specified using a file: URI value, java.io.IOException is thrown, indicating that

“The filename, directory name, or volume label syntax is incorrect”

e.g. >java -cp ./testng-6.5.1.jar org.testng.TestNG "file:///C:/TEMP/testng.xml"

A suggested fix is to replace line 148 in org.testng.xml.Parser with

147 if (m_fileName != null) {
148     File mainFile = (m_fileName.startsWith("file:"))
                ? new File(URI.create(m_fileName)) : new File(m_fileName);

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
krmahadevancommented, Sep 18, 2017

Let me see if I can send a PR that addresses this.

1reaction
juherrcommented, Sep 18, 2017

@krmahadevan I think we just have to try to convert the string to URI (convert it to “file://” if fails) and provide the URI to ISuiteParser:

boolean accept(URI uri);
Read more comments on GitHub >

github_iconTop Results From Across the Web

3 - Stack Overflow
I have installed TestNG plugin in eclipse still I see the below error Referenced file contains errors (http://testng.org/testng-1.0.dtd).
Read more >
During running testng xml file get error. | Selenium Forum
During running testng xml file get error. ... <?xml version="1.0" encoding="UTF-8"?> ... Error i am getting : org.testng.TestNGException: org.xml.
Read more >
Any idea how to get rid of this FNF exception while running in ...
Parser.parse(Parser.java:248). at org.testng.TestNG. ... FileNotFoundException: /<project-path>/10 (No such file or directory). at java.io.
Read more >
TestNG by default disables loading DTD from unsecured Urls ...
I was trying to run a simple TestNG test from the IntelliJ Idea as in the below screenshot. But ended up with the...
Read more >
Untitled
Lindsay pillatsch, Football u17 nationaux, Bataluri petrom? ... Easy marwari mehndi designs, Fxp file type, Gift for christmas for kids, Preterist view of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found