cancel
Showing results for 
Search instead for 
Did you mean: 

TC report an error " Unexpected window: '' " for one normal subobject.

SOLVED
Highlighted
Contributor

TC report an error " Unexpected window: '' " for one normal subobject.

     Like the pic, it report an error for unexpected window, but it don't trigger my events llike last unexpected window,

And the unpxected point to "

Sys.Process("Inventor").WPFObject("HwndSource: MiniFrameBorder", "", 1)

" that belongs to my tested app. But If last waring unexpected window don't appear, the error unexpected window won't appear.

So my question how to handle the second error unexpected window?

And it's my events:

 

Sub GeneralEvents_OnUnexpectedWindow(Sender, Window, LogParams)


Call Log.Picture(Window, "Screen image", "This image was added to TestLog from the GeneralEvents_OnUnexpectedWindow procedure")
Log.Warning "Unexpected Window",, pmNormal
If Window.WndClass = "#32770" Then
If Window.waitWindow("Button","&Yes",,5000).Exists Then Window.waitWindow("Button","&Yes",,5000).Click
If Window.waitWindow("Button","&OK",,5000).Exists Then Window.waitWindow("Button","&OK",,5000).Click


End If

End Sub

 

Capture1.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: TC report an error " Unexpected window: '' " for one normal subobject.

Hi,

 

While it is good to know that you've solved the problem, I would pay attention to the 'The action may be performed incorrectly...' warning and improve test code to handle this properly.

 

As a note: OnUnexpectedWindow event is triggered when test code tries to activate some window but fails to do this because the window cannot be activated (i.e. put in front of user) due to be overlapped by another application- or system-modal window.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

3 REPLIES 3
Highlighted
Contributor

Re: TC report an error " Unexpected window: '' " for one normal subobject.

" If Window.WndClass = "#32770" Then " was commented and should be deleted.

Highlighted
Community Hero

Re: TC report an error " Unexpected window: '' " for one normal subobject.

Hi,

 

While it is good to know that you've solved the problem, I would pay attention to the 'The action may be performed incorrectly...' warning and improve test code to handle this properly.

 

As a note: OnUnexpectedWindow event is triggered when test code tries to activate some window but fails to do this because the window cannot be activated (i.e. put in front of user) due to be overlapped by another application- or system-modal window.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Contributor

Re: TC report an error " Unexpected window: '' " for one normal subobject.

Thanks, the issue still exists in my project. But for your information, I know how to trigger the unexpected window. Maybe tested App has conflict with Testcomplete. I will work on it to solve.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors