Error while saving an object

This error pops up when saving this specific object otherwise it works fine, was able to save the object before but somehow it got deleted

1 Like

Hi @riteshshikne,

Welcome to our community. Thank you for sharing your issue.

Can you please help provide error log, double check on your locator and test with that manually, KS using and OS, …? Thank you

Can u pls restart katalon studio and then check again

@riteshshikne

Please provide the error log. In the error log, I believe a fatal error is recorded with a stacktrace. That will reveal the cause of the failure, and will suggest some workaround if any.

But, how to get the error log?

Katalon Studio Command Bar, Help > Error log

Then .log file will be opened in a text editor

You can copy the whole text and paste it here. Very large? You don’t have to worry about it. Provide the .log in its entirety. Don’t trim it at all!

.log (333.6 KB)

While doing it manually its working fine

.log (333.6 KB)

Thanks for the info, I can now capture the object while adding it to a new folder, but it gets deleted after I restart Katalon

Thank you for the log.

In the log file, I could find the following exception thrown repeatedly.

Exception Description: An error occurred unmarshalling the document
Internal Exception: org.xml.sax.SAXParseException; systemId: file:/C:/Users/Ritesh.shinke/Katalon%20Studio/My%20First%20Web%20UI%20Project%20(1)/Object%20Repository/SERIVICE%20CONTRACT%205/div_1%20-%20Invoicing.rs; lineNumber: 55; columnNumber: 49; An invalid XML character (Unicode: 0x1e) was found in the element content of the document.
	at org.eclipse.persistence.exceptions.XMLMarshalException.unmarshalException(XMLMarshalException.java:122)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.convertSAXException(SAXUnmarshaller.java:1045)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:948)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:416)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:392)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:347)
	at org.eclipse.persistence.internal.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:366)
	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:146)
	... 82 more
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/Ritesh.shinke/Katalon%20Studio/My%20First%20Web%20UI%20Project%20(1)/Object%20Repository/SERIVICE%20CONTRACT%205/div_1%20-%20Invoicing.rs; lineNumber: 55; columnNumber: 49; An invalid XML character (Unicode: 0x1e) was found in the element content of the document.
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1465)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2854)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
	at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:246)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:940)
	... 87 more

The message says:

An invalid XML character (Unicode: 0x1e) was found in the element content of the document.

“Unicode: 0x1e” is the “greater than” character >.

The message says that a > is found at a wrong place in the XML file file:/C:/Users/Ritesh.shinke/Katalon%20Studio/My%20First%20Web%20UI%20Project%20(1)/Object%20Repository/SERIVICE%20CONTRACT%205/div_1%20-%20Invoicing.rs, which is what we call “Test Object” in “Object Repository”.

Your Test Object contains a > character in the locator string:

This > caused the SAXParseException.

I believe, this is a bug of Katalon Studio. It must refrain from SAXParseException.

It was interesting to find that @riteshshikne chose a Selection Method “Smart Locator”

I don’t know Smart Locator at all. I have never used it.

Smart Locator is a new feature introduced at v10.0.0. Your report of this bug indicates that Katalon hasn’t tested the Smart Locator enough. :smiling_face_with_horns:

I think you had better choose classical CSS Selector, Attributes, or XPath which will not allow you to write “greater than” character > in the locator expression.

Thank you for your response.

I chose CSS Selector, Attributes, and XPath, but it still results in the same error. Additionally, Katalon is deleting this object after each restart, while another object in the column named “invoicing” functions correctly and persists. Why is Katalon unable to retain this specific object
.log (608.2 KB)

You have to erase the current value of “Selected Locator” which contains naughty > characters.


Make it blank!

And then, you should write new Locator cleanly.

You should put your various pathways here so we can see what you have. XPath does not start with a square bracket, but either one or two slashes. So, you would start your pathway as:
//*[@id='fndTreeView-treeNode-CONTRACT...']

It looks like you will also have to use the and in your pathway as you have several different attributes you are trying to use.

If you are going down to child nodes, then use the forward slash, like:
//*[@id='fndTreeView-treeNode-CONTRACT...']/div/...

but if you want to go down more than a single child node, then, two forward slashes:
//*[@id='fndTreeView-treeNode-CONTRACT...']//div/...

Use either CSS or XPath, but the two are different in their form.

Thank you @kazurayam and @grylion54 , I found a workaround, instead of capturing full object now I am just capturing the blue dots in front of the object which is working as expected.

I’m just curious, how does your successful locator string look like? It contains no > character, am I right?

Yes, it does not contain > character,
for your reference, here is the Xpath : //*[(@_ngcontent-ng-c1641312967 = ‘’) and (name() = ‘li’) and (position() = 2)]//i[@class and contains(concat(’ ', normalize-space(@class), ’ '), ’ icon-circle-solid ') and (@_ngcontent-ng-c1641312967 = ‘’)]

Thank you for your reply.

If you’d like, please use the “Code Formatting syntax” as follows:

This will make your code in the above post more readable.

1 Like

@Elly_Tran

Please inform your development team of this bug.
I believe, they should address this A.S.A.P.
Otherwise the new Smart Locator feature wont be accepted.

Hi,

I have created a new ticket on this for my team to investigate. I will update with you guys soon with anything new.

Thank you

1 Like

Hi @riteshshikne, @kazurayam,

Sorry for my late response. Our team cannot reproduce the error, we tried with many way, include modify the source of html but got no luck. This issue cannot reproduce. The issue is not come from > characters, see the image below for details:

Can you guys help share the way to reproduce the problem? Thank you!

In the .log file, I found a message repeated:

Internal Exception: org.xml.sax.SAXParseException; 
    systemId: file:/C:/Users/Ritesh.shinke/Katalon%20Studio/My%20First%20Web%20UI%20Project%20(1)/Object%20Repository/YEARLY%20MAINTENANCE%202/3div_2%20-%20Yearly%20Maintenance.rs; 
    lineNumber: 55; columnNumber: 49; 
    An invalid XML character (Unicode: 0x1e) was found in the element content of the document.

@riteshshikne

Could you share this file:/C:/Users/Ritesh.shinke/Katalon%20Studio/My%20First%20Web%20UI%20Project%20(1)/Object%20Repository/YEARLY%20MAINTENANCE%202/3div_2%20-%20Yearly%20Maintenance.rs?

Please let the Katalon developers to look at the file, at the lineNumber 55, columnNumber 49 and verify if any problem in the file as the message says.