Getting 'Failed to instrument WPF process'

Best practices, code snippets for common functionality, examples, and guidelines.
Roman Snitsar
Posts: 5
Joined: Tue May 14, 2019 1:37 pm

Getting 'Failed to instrument WPF process'

Post by Roman Snitsar » Tue May 14, 2019 3:19 pm

Hi,
I have a few tests that work well on the computer where they were created. But when I try to run this tests on another machine I get this warning:

Failed to instrument WPF process. UI element identification capabilities for this window are limited. Exception while initializing WPF proxy: System.Runtime.Remoting.RemotingException: This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.

Server stack trace:
at System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(IMethodCallMessage reqMcmMsg, Boolean useDispatchMessage, Int32 callType)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System._AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
at Ranorex.Core.Injection.DotNetThingy.CreateInstanceInDomain[T](_AppDomain domain)
at Ranorex.Core.Injection.DotNetThingy.CreateAssemblyResolversInDomains(IEnumerable`1 domains)
at Ranorex.Core.Injection.DotNetThingy.UpdateDomainInfos()
at Ranorex.Core.Injection.DotNetThingy.GetAppDomainIds()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Ranorex.Core.Injection.IDotNetThingy.GetAppDomainIds()
at Ranorex.Plugin.WpfFlavor.InjectWpfAutomation(ProcessInfo proc, IDotNetThingy dnproxy)
Process: 'OUTLOOK' (pid 14148)
The following website provides more information on this technology limitation:
https://www.ranorex.com/help/v8.3/inter ... #DotNetWPF
(This message is only shown once per report.)


and Ranorex can't find required elements, because they have completely different xpath.
On the machine where tests were created:
Capture3.PNG
On another machine:
Capture4.PNG
I am testing Outlook add-in and desktop application. Ranorex settings the same on the both machines:
Capture2.PNG
the same windows user and outlook account. Outlook, AUT and windows versions are the same too. I have no idea what is wrong :( .
Any help will be appreciated. Thanks in advance.
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Getting 'Failed to instrument WPF process'

Post by odklizec » Tue May 14, 2019 10:12 pm

Hi,

At first, what Ranorex version do you use? Most recent version is 9.0.1. If you are using something older, please update your Ranorex version. At next, could you please upload a Ranorex snapshot (NOT screenshot) of the same element, taken on both computers? And finally, are you sure Ranorex settings, .net and vc++ runtime libs are the same on both computers?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Roman Snitsar
Posts: 5
Joined: Tue May 14, 2019 1:37 pm

Re: Getting 'Failed to instrument WPF process'

Post by Roman Snitsar » Wed May 15, 2019 12:43 pm

Hi,
I have updated my Ranorex version, but nothing has changed.
Ranorex settings are the same, because I get my solution from TFS server, and additionally I have checked them. My .NET Core SDK and Visual C++ version are the same on both computers. And there is one detail - when I close AUT and Outlook and next run the test case manually, all is well end items have required look (as on the first computer).
Here are my snapshots:
Snapshot1.rxsnp
You do not have the required permissions to view the files attached to this post.
Last edited by Roman Snitsar on Wed May 15, 2019 1:07 pm, edited 2 times in total.

Roman Snitsar
Posts: 5
Joined: Tue May 14, 2019 1:37 pm

Re: Getting 'Failed to instrument WPF process'

Post by Roman Snitsar » Wed May 15, 2019 12:52 pm

Snapshot from test computer (2)
Snapshot1.rxsnp
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Getting 'Failed to instrument WPF process'

Post by odklizec » Wed May 15, 2019 1:07 pm

Hi,
OK, at first look, both computers use different version of Windows. The one with different UI structure and WPF error uses newer version. At next, have you tried to run the test from Studio, started as administrator? This often helps with similar kind of issues.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Roman Snitsar
Posts: 5
Joined: Tue May 14, 2019 1:37 pm

Re: Getting 'Failed to instrument WPF process'

Post by Roman Snitsar » Wed May 15, 2019 3:33 pm

I ran the tests on the third computer that has the same OSVersion that has first computer and the same user was logged in Windows, but it does not work.
Snapshot3.rxsnp
I have already tried to run Ranorex as administrator, but it does not work too.
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Getting 'Failed to instrument WPF process'

Post by odklizec » Thu May 16, 2019 11:53 am

Hi,

Well, without seeing the whole test in action, it's really hard to say what's wrong. I would suggest to contact Ranorex support and request a remote session with them, so they can examine it in realtime and eventually suggest a solution/workaround.

Just one additional thought...outlook is started directly by test or it's already running before you start the test? This could the root cause of the issue. And finally, the version of Outlook is the same on all computers?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Roman Snitsar
Posts: 5
Joined: Tue May 14, 2019 1:37 pm

Re: Getting 'Failed to instrument WPF process'

Post by Roman Snitsar » Thu May 16, 2019 12:53 pm

Hi,
The outlook version is the same and outlook is started directly by the test. It seems I have to contact Ranorex support. Thank you for
your time and answers :)

gridle
Posts: 19
Joined: Mon Mar 10, 2014 5:13 pm

Re: Getting 'Failed to instrument WPF process'

Post by gridle » Mon May 27, 2019 10:02 am

Hi,
I am getting the same "Failed to instrument WPF process" message. It appears in the very beginning of the test when tests start WPF application. On screenshots I can see that app is loaded but test can't find elements of it and test fails.
Usually i am getting this message if I execute bunch of tests via TeamCity on VM. In case I run tests directly from Ranorex on the same VM - i don't get this message.
Ranorex version is 9.0.1. On previous version (8.x.x) I faced with this message very seldom. But on the current version almost every execution i get this message.
Can this message be related to low performance (low memory and etc) of VM?

thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Getting 'Failed to instrument WPF process'

Post by Support Team » Tue May 28, 2019 6:29 pm

Hello Gridle,

Based on the description I recommend you verify you are running Ranorex and the App in administrator mode. I also recommend trying the Ranorex Agent to run your test on the VM. If the issue persists please create a support query so that we may investigate this issue further.

Regards,
Sean

gridle
Posts: 19
Joined: Mon Mar 10, 2014 5:13 pm

Re: Getting 'Failed to instrument WPF process'

Post by gridle » Tue Jun 04, 2019 9:33 am

Hi,
I solved my problem above with increasing of RAM on my VM.
Good luck!