Suddenly unable to find WPFObject

Originally posted by joscva on May 21, 2025

Today I’ve been building a test case for a repetitive task I needed to plow through. Everything was fine, it was working perfectly. Then out of the blue, for no reason at all that I can see, one of the very first steps in the test began to fail due to WPFObject not existing.

I’m testing a WPF Desktop app, and it has a main menu called “Menu”. When clicked, it drops down to reveal other items including one called “Connections”. Within that, are various datafeed sources the user can select.

This is brain-dead simple, and it’s a core component of many of the tests I’ve created. I have never, ever, had it fail in the months I’ve ben working in TestComplete. It works on Visual Studio source branches, and it works on compiled/obfuscated builds. Never an issue, until now.

U stick to Keyword Tests at all times unless there is absolutely no other option. I can manually record a test of me clicking Menu, then Connections, then a sub-menu item, and the result is an extremely simply Menu Action operation like this:

“MENU|Connections|[4]”

It doesn’t get much simpler. But now, out of nowhere, it just fails 100% of the time. It doesn’t even get to selecting Connections, which is where the failure is. It clicks Menu, then just loops infinitely looking for WPFObject (until I kill it).

I thought maybe somehow there was something in the TC update I installed this morning before I began building the test, so I uninstalled and rolled back. No change.

I thought maybe somehow something had gone wrong with the new build of our app that came out today, so I removed it and rolled back to what I began with this morning. No change.

I thought maybe it was obfuscation related (we’ve seen strange things crop up occasionally due to it) so I ran from source. No change.

Relaunched TC and our app several times, no change.

Rebooted my PC, no change.

I’m at my wits’ end. This worked perfectly, right up until the moment it didn’t, and I hadn’t changed anything between it working, and not working. Anyone have any suggestions on what to do or look for here?

Originally posted by scot1967 on May 22, 2025

Hello joscva,

There is a lot going on here. The short of it is the menu automation has stopped working.

  • TestComplete has been updated and rolled back.
  • You are testing a new version of your application.

I normally start by examining the suspect object with the spy tool and then use the record script option (instead of a keyword test) to record the actions and examine the script.

It would also be useful to perform a source dif on this area of the new app version and on the TestComplete project to ensure no changes are noted.

A new object inserted in the object tree can be the cause of many issues like this.

… If you find my posts helpful drop me a like! :+1: Be sure to mark or post the solution to help others out and/or to credit the one who helped you. :smiling_face_with_sunglasses:

Originally posted by rraghvani on May 22, 2025

Just to summarise, WPFObject it not being identified? Providing you are using the version of TestComplete that was working. Can you ensure you have the appropriate Extensions installed (and Desktop license too), see https://support.smartbear.com/testcomplete/docs/working-with/extending/extensions-dialog.html.

Can you create a new project, and use the Object Spy or Object Brower tool on your UI control. What does it show?

Originally posted by joscva on May 22, 2025

Thanks for replying. Extensions are all installed, licensing is fine.

Object Spy cannot select any item in the menu, using Point & Fix. When I try, it highlights the Connections item in red but won’t select it. Once I click off then Object Spy recognizes that the object apparently doesn’t exist, and Menu Action of MENU|Connections won’t work.

However, If instead I click only Menu, then explicitly do a separate On-Screen Action click of Connections, it works fine, but then I’m still unable to select any of the items under the Connections sub-menu.

Originally posted by scot1967 on May 22, 2025

I normally record a script from the performance of screen actions expected in these cases and then examine what TestComplete records. In most cases TestComplete will record an X,Y click if it can’t record the object path/identification. This will tell you exactly what TC is not able to see or it will identify and record it and you can then modify your test accordingly.

Originally posted by joscva on May 22, 2025

But the Menu|Connections|[4] IS what TC recorded. That is exactly what it recorded, and won’t play back. Thus, my confusion.

Originally posted by rraghvani on May 22, 2025

I’m not referring to Point & Fix, I want to see what the Object Browser or Object Spy shows, using a new project. For example,

Originally posted by scot1967 on May 22, 2025

Can you post the script you captured?

  1. If the script you recorded looks right and has no X,Y clicks, does the log indicate a click action during the run?
  2. Is the script timing out because the object can’t be found.
  3. It would be interesting to know how the name map is configured.

Originally posted by joscva on May 22, 2025

Here is what I have…

The run never times out, I have to manually stop it otherwise it appears that it will run indefinitely. I’ve let it go several minutes just to check.

Originally posted by joscva on May 22, 2025

I don’t understand, the object in question is in the menu, so I can’t spy it without using Point & Fix. It is also not possible to view in the Object Browser for the same reason.

Originally posted by joscva on May 22, 2025

Thanks, I don’t really follow however.

I have recorded as a script as well, and I get the exact same behavior. Here is the script TC recorded:

def Test1():
  Aliases.Tickblaze_View.Desktop.Menu.WPFMenu.Click("MENU|Connections|New Data Connection...")

I tried to get it to click an item within the Connections section of the menu, but it can’t because it never clicks Connections.

Originally posted by Hassan_Ballan on May 22, 2025

I am trying to follow the conversation, desktop is not my specialty so I don’t have a horse in this race; however, few things caught my eyes.

Note: The only difference between KeywordTest and code based scripts is viewing operations visually versus reading code, and the KeywordTest can be converted into code script.

  1. Please confirm that you tried it in a new empty project. You only need to record and play back the two clicks “MENU|Connections”. If it fails, wait for it to timeout (once I had to wait 20 minutes), and provide the log Details message and the Picture.

  2. Based on your statement “When I try, it highlights the Connections item in red but won’t select it.”, when you use the Spy option “Point and fix”, are you also using (Shift+Ctrl+A) to select the highlighted in red?

  3. Rather than having a single operation to navigate the menu, can you attempt it in multiple operations

Aliases.Tickblaze_View.Desktop.Menu.WPFMenu.Click("MENU");
Aliases.Tickblaze_View.Desktop.Menu.WPFMenu.Click("Connections");
Aliases.Tickblaze_View.Desktop.Menu.WPFMenu.Click("New Data Connection...");

:speech_balloon: If a response helped you out, don’t forget to Like it! And if it answered your question, mark it as the solution so others can benefit too.

Originally posted by scot1967 on May 22, 2025

Based on your settings your namemap is going to ‘self heal’ so object mappings may change and this would be seen in your test logs at some point.

Like Hassan mentioned, a shot of the details would be very helpful.

Originally posted by joscva on May 22, 2025

Appreciate your input.

  1. Yes, new empty project. I’ll do it again though and just walk away to see how long it takes to completely time out. Will have to wait until I don’t need to touch my machine for an extended period, so I don’t know when I’ll get to this.

  2. I can’t use Ctrl-Shift-A as that is mapped to things in other applications, but I always change the hotkey to Ctrl-Shift-` (backtick) so the principle is the same. I highlight it, and hit the hotkey, it then stays highlighted but nothing happens, and as soon as I click on anything else on the machine, the Spy operation ends and I’m faced with lots of "the object disconnected’ messages in it.

  3. This is what I get:

    As usual, the second item cannot be clicked because it doesn’t exist for some reason.

Originally posted by joscva on May 22, 2025

But what details? I’ve provided everything I’m aware of having been asked for.

Then again this forum is awful in terms of layout/structure and it’s extremely easy to not see replies that are buried under a dozen levels that all require expanding. I try not to miss anything though.

Originally posted by joscva on May 22, 2025

Oh also I’ve always used Self Healing mode, it’s never given me any trouble. And again, this test worked perfectly for hours… until the moment it didn’t.

Originally posted by Hassan_Ballan on May 22, 2025

In addition to the log message, the log details and picture are crucial for diagnostic. It would also help to share.

Thanks for your honesty. It’s true that the layout can make following some conversations a bit tricky, especially in longer threads. I appreciate you making the effort to stay engaged despite that. Hopefully, with feedback like yours, improvements can be considered to make the forum experience smoother for everyone. In long threads like this one I find it helpful to refresh the page to load all posts, sort by oldest to maintain the conversation, and expand all branches for the entire thread to review.

Originally posted by joscva on May 22, 2025

Thanks, here is the screenshot and log details…

Total number of items: 1.
Items: ‘MENU’.

Tested object:
Sys.Process(“Tickblaze.View”).WPFObject(“HwndSource: LMDfvLoyMBSdEr8E0t3”, “My Desktop”).WPFObject(“LMDfvLoyMBSdEr8E0t3”, “My Desktop”, 1).WPFObject(“Grid”, “”, 1).WPFObject(“Menu”, “”, 1).WPFMenu

Originally posted by joscva on May 22, 2025

OK I let it go for over 22 minutes just failing to find the object, before I finally killed it. Now it’s just stuck on “Stopping…” and I have my doubts that it will recover.

Originally posted by joscva on May 22, 2025

It did finally recover, I walked away for about 10 minutes and it had finished when I came back. Nothing useful in the log, just a zillion rows like this.