Forum Discussion
Hassan_Ballan
Champion Level 3
1 hour agoIn TestComplete this usually happens for one of these reasons:
Most commonly (especially with WPF apps), the dialog isn’t actually being recreated the second time — it’s just being hidden and shown again. If the window object never gets destroyed, TestComplete doesn’t treat it as a “new” unexpected window, so the event won’t fire again. You can confirm this in Object Browser by checking whether the window truly disappears from the hierarchy or just toggles Visible, rather than being removed completely.
Other things worth checking:
- Make sure the event is still enabled under Project → Properties → Events
- Verify the second dialog really matches the same process/class/caption (sometimes the caption text, parent, or index changes slightly)
- Ensure it wasn’t added to Name Mapping after the first run. If it’s mapped (or falls under a mapped parent), TestComplete may now treat it as a known object instead of an unexpected one, so the event won’t trigger
- Increase the Auto-wait timeout in case the test step fails before the event handler has a chance to execute
If this resolves your scenario, marking it as the solution helps future readers find it quickly.