CreateImageResource fails

Ranorex Spy, Recorder, and Studio.
crisb
Posts: 5
Joined: Tue Mar 24, 2015 9:29 pm

CreateImageResource fails

Post by crisb » Tue Nov 24, 2015 2:40 pm

This is something that has been driving me nuts for the last year. I'm going along, merrily creating tests and running them, when all of a sudden, I'll get a warning the CreateImageResource task fails. This should be a benign error but in my case it is not. As my tests are run as part of a LabManagement build/deploy/test cycle and our policy for all code is to treat warnings as errors. So my tests fail to compile.

I've tracked it down to a bad control in the repository. A control that was recorded and not touched, will occasionally just get bad data when it's written out to the repository when it's recreated with a new recording. The way to debug it is to slowly delete each control, fix up refs until it can compile and keep doing this until the error goes away. Of course this is a massive waste of time and can take forever if you have a lot of tests and a big repository. Another approach is to push a copy that compiles without errors into our source code repository, then rollback when it fails and debug each added step until I can identify the control. This is not a desired alternative again.

A simple 15 min test/record can turn into a 2 hour pain. I've tried looking into the xml in the repository but I had no luck in identifying the offending control.

Often when I find the control that is breaking, it had already been recorded in a previously test, and was just being reused in another. But that's not always the case.

This happened occasionally with v4.x but seems much more frequent with 5.x. This is killing my productivity and making my bosses question Ranorex.

I'm running Ranorex 5.4.0.24580
on Win7 Professional 64 bit

Here's the error:

The "CreateImageResources" task failed unexpectedly.
System.Xml.XmlException: '', hexadecimal value 0x01, is an invalid character. Line 847, position 19.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at Ranorex.Core.Repository.ElementRepository.RepositoryXmlReader..ctor(String repoFilePath)
at Ranorex.Core.Repository.ElementRepository.UpdateImageResource(String repoFilePath, String outputDirectory)
at Ranorex.MSBuildTasks.CreateImageResources.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) (MSB4018) - C:\Program Files (x86)\MSBuild\Ranorex5\Ranorex.MSBuild.Targets:1

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: CreateImageResource fails

Post by Support Team » Thu Nov 26, 2015 1:17 pm

Hi crisb,
As you have already noticed, this error is usually related to a broken repository. To facilitate the analysis of this issue I'd like to ask you to send a copy of your Ranorex project to [email protected]. This would allow me to analyze the issue directly on my controlled environment.
Thank you.

Regards,
Markus (S)
.
Image

crisb
Posts: 5
Joined: Tue Mar 24, 2015 9:29 pm

Re: CreateImageResource fails

Post by crisb » Tue Dec 01, 2015 7:40 pm

Project zipped and sent to support.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: CreateImageResource fails

Post by Support Team » Thu Dec 03, 2015 11:19 am

Hi Crisb,

Thank you for sending me the project. I'll update this posting as soon as I've found the source of the problem.
Thank you for your patience.

Update: I was successfully able to narrow down the source of this warning. Some special character messed up the Recording file. To understand what exactly caused this problem, I'd like to discuss this issue during a short remote session. I've sent you an email containing additional information.

Regards,
Markus (S)
.
Image

antonandreev84
Posts: 6
Joined: Fri Mar 17, 2017 3:06 pm

Re: CreateImageResource fails

Post by antonandreev84 » Mon Mar 27, 2017 1:18 pm

Hello!
I have the same problem in version Ranorex 5.4.4.
Help me solve this problem?
Thank you in advance for your cooperation

(непредвиденная ошибка при выполнении задачи CreateImageResources".
System.Xml.XmlException: ".", шестнадцатеричное значение 0x00, является недопустимым знаком., строка 506, позиция 208.
в System.Xml.XmlTextReaderImpl.Throw(Exception e)
в System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
в System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
в System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
в System.Xml.XmlTextReaderImpl.ParseAttributes()
в System.Xml.XmlTextReaderImpl.ParseElement()
в System.Xml.XmlTextReaderImpl.ParseElementContent()
в System.Xml.XmlTextReaderImpl.Read()
в System.Xml.XmlTextReader.Read()
в Ranorex.Core.Repository.ElementRepository.RepositoryXmlReader..ctor(String repoFilePath)
в Ranorex.Core.Repository.ElementRepository.UpdateImageResource(String repoFilePath, String outputDirectory)
в Ranorex.MSBuildTasks.CreateImageResources.Execute()
в Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) (MSB4018) - C:\Program Files (x86)\MSBuild\Ranorex5\Ranorex.MSBuild.Targets:1)
Support Team wrote:Hi Crisb,

Thank you for sending me the project. I'll update this posting as soon as I've found the source of the problem.
Thank you for your patience.

Update: I was successfully able to narrow down the source of this warning. Some special character messed up the Recording file. To understand what exactly caused this problem, I'd like to discuss this issue during a short remote session. I've sent you an email containing additional information.

Regards,
Markus (S)

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: CreateImageResource fails

Post by jma » Thu Mar 30, 2017 3:06 pm

Hi antonandreev84,

Please note that Ranorex 5.4.4 is already outdated and not supported anymore. I would suggest updating to the latest version of Ranorex and check if this resolves the issue.