Invisible window not found

Best practices, code snippets for common functionality, examples, and guidelines.
HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Invisible window not found

Post by HansSchl » Thu Apr 06, 2023 9:40 am

Hi,

I recently upgraded Ranorex from 10.1.3 to 10.5.4. Since then, a number of tests started to fail. One of the symptoms of failure is that Ranorex doesn't find invisible windows. Let me explain what I mean.

The AUT is a non-managed C++ application, using MFC. Its GUI is flexible and is sometimes modified during runtime. Some automatic tests verify which GUI elements are displayed and which aren't. Elements can be removed from the screen (effectively calling the API function DestroyWindow), or they can be hidden by calling ShowWindow(SW_HIDE) which leaves the window object in place but eoved the WS_VISIBLE flag, so that the window is no longer displayed on the screen. This question is about the latter scenario. I have verified this, using the "Spy++" tool from Microsoft.

The test does an "AttributeEqual" validation step, comparing the "Visible" attribute against the value "False". This worked before the Ranorex upgrade, and now fails with "No element found for path ... at step 'element[@windowtext='VU Meter']" when in fact I can see this invisible control in Spy++.

I believe this is a bug in the latest version of Ranorex. Comments welcome.

Best regards
Hans

rshah
Posts: 2
Joined: Mon Apr 10, 2023 1:37 pm

Re: Invisible window not found

Post by rshah » Mon Apr 10, 2023 2:43 pm

After upgrade of Ranorex from 6.1.1.0 to 10.5.4, facing the similar challenge and the only difference is my window is visible but still getting "No element found for path '/form[@controlname='LoginForm']' at step '' after 1 attempts within 5s."
But the same code is working with 6.1.1.0 version.

I sent email to Ranorex support but no response on this problem, looks like they have some issue but not sure why no response from the team.

"Host.Local.FindSingle<Ranorex.Form>" throwing exception for me, even I tried to give 5 minutes of duration where as spy is able to find the control withing a second through same rxPath

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Invisible window not found

Post by Stub » Tue Apr 11, 2023 8:40 am

It's a bug I reported in Summer 2022, which got fixed only recently: invisible-controls-missing-from-v10-2-1-t21894.html

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Invisible window not found

Post by HansSchl » Tue Apr 11, 2023 10:41 am

What a long thread. I asked over there where to find this option.

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Invisible window not found

Post by HansSchl » Fri Apr 28, 2023 9:46 am

Thank you for your help @Stub. After a lengthy fight against hardware problems on the test system I can confirm that it works.

Best
Hans