Spy does not show QtElement information

Ranorex Spy, Recorder, and Studio.
AlexS
Posts: 2
Joined: Mon Mar 23, 2020 9:28 am

Spy does not show QtElement information

Post by AlexS » Mon Mar 23, 2020 12:15 pm

Hello,

I've tried to setup a basic Windows 10 VM for testing a Qt application. Tested via Proxmox and VirtualBox VM
On my laptop the spy shows the Qt specific infomations but on the VM it is missing.
Laptop:
qtelement_ranorex_spy.png
qtelement_ranorex_spy.png (7.14 KiB) Viewed 72 times
The application is a standard c++ Qt Mainwindow Demo example (Qt version 5.14.1)
https://www.ranorex.com/help/latest/int ... t-testing/

Is there any special I have to install before I can see the QtElements within the VM?

Things I have tried:
  • I have tried 32 or 64 bit spy with and without "Qt legacy automation mode" and admin rigths, but it don't show the QtElement.
    I also tried to install some vc_redist.x64.exe versions after I read this thread https://www.ranorex.com/forum/about-ide ... 12687.html
    Set whitelist to ignore other running apps
    The spy log shows some exceptions
    Ranorex.Spy.log
    from virtual box
    (96.68 KiB) Downloaded 1 time

Code: Select all

2020-03-20 05:47:29.956| WARN|Ranorex.Plugin.QtWindowRule|Failed to fetch QtBase interface from hwnd: 197584. Ranorex.Core.HwndInvokerException: Exception of type 'Ranorex.Core.HwndInvokerException' was thrown. Window Handle: 197584.Orig. Message: System.NullReferenceException: Object reference not set to an instance of an object.
   at Ranorex.QtInjector.QtAutomationImpl.GetAppInfo()
   at Ranorex.Core.HwndInvokerControl.<>c__DisplayClass26_0`1.<Call>b__0(Object[] a)
   at Ranorex.Core.HwndInvokerControl.MainThreadHookProc(Int32 nCode, IntPtr wParam, IntPtr lParam)
---STACKTRACE---
Ranorex.Core.HwndInvokerException: Exception of type 'Ranorex.Core.HwndInvokerException' was thrown. Window Handle: 197584.Orig. Message: System.NullReferenceException: Object reference not set to an instance of an object.
   at Ranorex.QtInjector.QtAutomationImpl.GetAppInfo()
   at Ranorex.Core.HwndInvokerControl.<>c__DisplayClass26_0`1.<Call>b__0(Object[] a)
   at Ranorex.Core.HwndInvokerControl.MainThreadHookProc(Int32 nCode, IntPtr wParam, IntPtr lParam)
  System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) +0x27
  System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 type) +0x1ba
  Ranorex.QtInjector.IQtBaseAutomation.GetAppInfo() +0xffffffff
  Ranorex.Plugin.QtWindowRule.Execute(GlueRuleExecutionState state) +0xa3
App snapshot from virtaul box
qtapp_virtualbox.rxsnp
(20.1 KiB) Downloaded 1 time
Downdload Qt demo app: https://www.dropbox.com/s/a5agjfi0cj4cc ... n.zip?dl=0
System information -------------------------------------------------------------------------------------------------
Ranorex Version: 9.1.0+gitefec75c7
.NET Runtime version: 4.0.30319.42000

VMs:
Image Win10_1909_English_x64.iso
OS Name Microsoft Windows 10 Pro
Version 10.0.18363 Build 18363

VirtualBox Version 6.0.10 r132072 (Qt5.6.2)
Proxmox Version: pve-manager/6.1-7/13e58d5e (running kernel: 5.3.18-2-pve)


Laptop:
OS Name Microsoft Windows 10 Pro
Version 10.0.18363 Build 18363
Last edited by AlexS on Tue Mar 24, 2020 1:04 pm, edited 1 time in total.

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

Re: Spy does not show QtElement information

Post by odklizec » Tue Mar 24, 2020 11:49 am

Hi,

In my opinion, there is something missing on the VM? I guess a VC++ runtime library or specific .net library? Please try to completely uninstall
Ranorex and then install most recent 9.3.1. Also, I noticed that there is mentioned Ranorex 8.3.2 on the screenshot you posted? This is kind of weird, since you are using 9.1?

If reinstalling Ranorex on VM (and ensuring all required libs are installed) does not fix the issue, then you need to discuss it directly with Ranorex support.
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

AlexS
Posts: 2
Joined: Mon Mar 23, 2020 9:28 am

Re: Spy does not show QtElement information

Post by AlexS » Tue Mar 24, 2020 2:53 pm

Hi Pavel,

thank you for your help.

1. The different ranorex version seems only an internal ranorex lib version and not the product version itself.
2. I have tried to use the 9.3.1 ranorex version, but with no success.
3. With your suggestion, I discovered that it works if I install the 2010 redistributables. Whereby it works on my laptop even without 2010 redistributables. It looks like it is a dependency on ranorex? because the QT app needs only the 2015-2019 version.
redistributables.PNG
redistributables.PNG (33.56 KiB) Viewed 59 times
Is there some documentation what I have to install? Only on suspicion of installing any libs seems a bit cumbersome to me.

regards
Alex

foals11
Posts: 15
Joined: Wed Sep 18, 2019 9:19 am

Re: Spy does not show QtElement information

Post by foals11 » Wed Mar 25, 2020 10:49 am

Hi,

I had a similar issue. I contacted the Ranorex Support and their developers have analyzed the issue.
According to the the Ranorex developers, Qt 5 applications need the Visual C++ 2010 Redistributables.

regards