Cannot validate the XSD schema for an xml report

Please let us know what you are using Katalon Studio for?

  1. I’m exploring the tool
  2. I’m building a Proof of Concept
    3. I have currently applied Katalon Studio in my project
  3. I’m learning automated test with Katalon Studio

How would your work be affected if this issue has not been resolved?

  1. It doesn’t affect much, but I believe Katalon team should have this ticket resolved
    2. I can continue my job, resolving this ticket can boost my performance
  2. I can continue my job, but my performance is lower than expected
  3. I cannot continue my job and have to work on something else while awaiting your response

Operating System

  • For example: Windows 10 or OSX Sierra

Katalon Studio Version 7.9.1

Katalon Studio logs

  • Windows logs folder: \config.metadata.log

  • macOS logs folder: file:///Applications/Katalon%20Studio.app/Contents/MacOS/config/.metadata/.plugins/org.eclipse.ui.workbench/log

Screenshots / Videos

  • Please attach screenshots or videos if necessary to reproduce the issue
    groovy.lang.MissingPropertyException: No such property: W3C_XML_SCHEMA_NS_URI for class: javax.xml.XMLConstants
    at test.run(test:17)
    at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
    at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
    at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:398)
    at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:389)
    at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:368)
    at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:360)
    at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:255)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
    at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
    at TempTestCase1615394854884.run(TempTestCase1615394854884.groovy:25)

I could reproduce your problem. The following Test Case script gave me “No such property: W3C_XML_SCHEMA_NS_URI for class: javax.xml.XMLConstants”.

import javax.xml.XMLConstants

println XMLConstants.W3C_XML_SCHEMA_NS_URI

I made a short study. I wrote a new Test Case script like this:

import javax.xml.XMLConstants

URL u = XMLConstants.class.getResource("/" + XMLConstants.class.getName().replaceAll("\\.", "/") + ".class");
System.out.println(u);

When I ran it, I got the following output:

2021-03-11 19:38:23.850 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2021-03-11 19:38:23.854 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/TCb
2021-03-11 19:38:24.909 DEBUG testcase.TCb                             - 1: u = XMLConstants.getResource("/" + getName().replaceAll("\.", "/") + ".class")
2021-03-11 19:38:24.926 DEBUG testcase.TCb                             - 2: out.println(u)
jar:file:/Applications/Katalon%20Studio.app/Contents/Eclipse/configuration/resources/lib/stax-api-1.0.1.jar!/javax/xml/XMLConstants.class
2021-03-11 19:38:24.954 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/TCb

This message clearly tells that Katalon Studio found and loaded the XMLConstants class from the stax-api-1.0.1.jar in the classpass.

What is StAX API? https://mvnrepository.com/artifact/stax/stax-api/1.0.1 Oh I remember it. I saw StAX API nearly 20 years ago! I believe that the project had already sunset. And now I found the project site http://stax.codehaus.org/ is already gone. It is quite likely that the implementation of javax.xml.XMLConstants class in the stax-api.-1.0.1.jar is a bogus one.

On the other hand you can easily find that the XMLConstants class is bundled in the JAXP API

https://docs.oracle.com/javase/8/docs/api/javax/xml/XMLConstants.html

@duyluong
@ThanhTo

Why the stax-api-1.0.1.jar is included in the Katalon Studios’ default classpath? I think you should consider removing it.

@anouar.baghouz

  1. I would recommend you NOT to try advanced XML processing in Katalon Studio, such as validating XML instances with XSD Schemas because I believe that nobody has ever tried it. You are likely to encounter more problems. If you want to do validation, you had better do it outside KS controlling the environment for yourself.

  2. Still you can try deleting “stax-api-1.0.0.jar” out of the Katalon’s classpath. I believe that the stax-api.x.x.x.jar is not necessary. Everything developed by that project has already been taken over by the JAXP API which is bundled in the JavaSE 1.4 and later.


I could not help trying it. I deleted the stax-api-1.0.1.jar from my Katalon Studio and ran the following script:

import javax.xml.XMLConstants

URL u = XMLConstants.class.getResource("/" + XMLConstants.class.getName().replaceAll("\\.", "/") + ".class");
System.out.println(u);

println XMLConstants.W3C_XML_SCHEMA_NS_URI

The output was fine:

2021-03-11 20:49:33.086 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2021-03-11 20:49:33.094 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/TCb
2021-03-11 20:49:34.930 DEBUG testcase.TCb                             - 1: u = XMLConstants.getResource("/" + getName().replaceAll("\.", "/") + ".class")
2021-03-11 20:49:34.955 DEBUG testcase.TCb                             - 2: out.println(u)
jar:file:/Applications/Katalon%20Studio.app/Contents/Eclipse/jre/Contents/Home/lib/rt.jar!/javax/xml/XMLConstants.class
2021-03-11 20:49:34.988 DEBUG testcase.TCb                             - 3: println(W3C_XML_SCHEMA_NS_URI)
http://www.w3.org/2001/XMLSchema
2021-03-11 20:49:35.013 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/TCb

The orthodox XMLConstant class was found and loaded from the JDK’s rt.jar.

It worked for after having deleted the stax-api-1.0.0.jar”.

Thanks for this alternative.
Have a nice day.

Thank you for your answer @kazurayam, Just for your info, it’s been almost 2 years that validating XML with XSD were working as expected until version 7.8.2. But since I have done the update of Katalon 2 days ago (current version = 7.9.1), my test cases with the validation of XML based on XSD are not working, this is why I revert back to you.
I will try to remove “stax-api-1.0.0.jar” as you have mentioned and see if it change something for me.

Kind regards,
Anouar BAGHOUZ

I believe you were the pioneer who did the XML validation in Katalon Studio. Thank you for the info.

By the way, I liked James Clark’s RelaxNG more than XSD.