-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestNG XML not valid with DTD @ http://testng.org/testng-1.0.dtd #1385
Comments
@brtu Ping @cbeust @krmahadevan |
From http://www.xmlvalidation.com/
From TestNG it should not happen because it uses the DTD included into the jar. @brtu What is the message from SAXParser? |
@juherr @cbeust updated the issue with the SAXParser message. I'm afraid it is pretty vague and not very helpful. I think that the https://raw.githubusercontent.com/cbeust/testng/master/src/main/resources/testng-1.0.dtd is correct, because when I change the DTD reference in the XML from the external reference
to a local reference
and put the following into www.xmlvalidation.com
and then copy+paste the results of https://raw.githubusercontent.com/cbeust/testng/master/src/main/resources/testng-1.0.dtd to www.xmlvalidation.com as a local reference, then there are no errors. Could there be a problem with the redirect? |
Yes, it looks like xerces doesn't follow redirection. BTW, what are you trying to do? If you need to access to |
Ah, I see. This problem arose when I was using the https://github.com/saikrishna321/AppiumTestDistribution library to run Appium tests in parallel. My quick workaround was just removing the DTD reference from the xml file so it wouldn't throw a parsing exception. I'll look into using another dtd resolver/ISuiteListener. |
@brtu In fact, I proposed 2 different solutions: |
I just removed the redirect and restored the actual |
@cbeust - I can confirm it works fine. I just now removed the |
@cbeust Thanks, I believe that this fixes the problem. When I plug the sample xml into www.xmlvalidation.com there are no errors that are found. |
org.xml.sax.SAXParseException; systemId: http://testng.org/testng-1.0.dtd; lineNumber: 1; columnNumber: 3; The markup declarations contained or pointed to by the document type declaration must be well-formed. |
That DTD hasn't changed in a while, no idea what is causing this right now.
…--
Cédric
On Wed, Apr 3, 2019 at 6:30 AM equazi ***@***.***> wrote:
org.xml.sax.SAXParseException; systemId: http://testng.org/testng-1.0.dtd;
lineNumber: 1; columnNumber: 3; The markup declarations contained or
pointed to by the document type declaration must be well-formed.
Above issue is back as April 03, 2019. All tests were working fine as of
yesterday but today we are getting above error message. Was there any
update done recently? Can anyone help? We are completely blocked by this.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1385 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFootZV56yAmwCjd95AYOvhma7Fsz5Sks5vdKzCgaJpZM4Mb0Wu>
.
|
Confirm, it's broken again today (yesterday worked fine).
If I change the link in xml to https the validation is passed. |
How is that broken, though? It's a 302, redirection, to the https version, and that https URL works:
|
Since Xerces doesn't honor redirections (which is baffling, to be honest), you should point to the |
If we use https in testng.xml and using maven surfire report then getting error |
Hi All, |
I removed the doctype tag from the testing.xml, then my tests are running fine without any errors. |
The XML parser you are using is not honoring redirects. Point to the DTD
on the https port directly.
…--
Cédric
On Wed, Apr 3, 2019 at 10:59 PM ssurai ***@***.***> wrote:
Hi All,
The parsing of Testng.xml with http://testng.org/testng-1.0.dtd was
working till 02-April-2019. It started failing parsing by throwing same
error same as error reported earlier from yesterday onwards i.e.
03-April-2019. Please help me how to overcome this issue.
Thanks,
Shyamal Surai
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1385 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFoogJHQY6nzd6uZmj8VsAbN9HqQqC0ks5vdZSCgaJpZM4Mb0Wu>
.
|
@cbeust
|
I curl the dtd file and saw a message that it was moved to https://testng.org/testng-1.0.dtd. So I just changed the url in my in the testng xml to https://testng.org/testng-1.0.dtd instead of http://testng.org/testng-1.0.dtd, now it's working on my end. |
@zloygreko I set up a redirect that automatically routes all traffic from port 80 to 443 on testng.org. This is a requirement to keep everyone safe. If your XML parser doesn't follow redirects, you should make sure to reference the DTD via https and not http. |
@cbeust : if we use https://testng.org/testng-1.0.dtd., i see maven-surfire is throwing connection reset when generating surefire-reports |
Hi! |
Because I recently configured testng.org to automatically redirect HTTP to HTTPS. Your options are either to point to the DTD at the HTTPS URL, or to use an XML parser that supports redirects. I'm a bit hesitant removing the rerouting because not using HTTPS is unsafe. |
By default, TestNG is not looking for the dtd on the web but takes the one from the jar. Another option could be to add the new URL in the Java XML Catalog but I don't know if all tools will support it. |
Right Click on the class, select Run--> Run configuration and update testng.xml file as follows |
Recently getting the error while trying to parse the HTTPS request with TestNG. |
By using TestNG 7.3.0, when JVM option Without the JVM option, test failed with error message: When changed to https, it works well. |
Thanks a lot, it's helped me |
I'm having this problem when using TestNG 7.3.0 in Eclipse. Where do you find the "TestNG xml" ... is that somehow generated by Eclipse? |
Please see stackoverflow link here:
http://stackoverflow.com/questions/42772424/testng-xml-not-valid
I am getting issues with the XML not meeting the DTD.
TestNG Version
Tried on 6.11 and 6.9.11
Expected behavior
XML should be valid with DTD.
Actual behavior
Getting the error: 1: 3 The markup declarations contained or pointed to by the document type declaration must be well-formed.
Is the issue reproductible on runner?
Test case sample
I have some generated TestNG XMLs that worked for a long time, but recently they are invalid when I run them through Java's SAXParser and through http://www.xmlvalidation.com/
Example generated XML:
Example XML from TestNG's site @ http://testng.org/doc/documentation-main.html
EDIT:
SAXParser error:
The text was updated successfully, but these errors were encountered: