Forum Discussion
According to the TestComplete Help, "empty strings specified as the WndCaption parameter's value are interpreted as strings that contain an asterisk (“*”), that is, TestComplete interprets such window captions not as empty strings, but as any strings."
What you need to do is after you test to see if the object exists, then test to see if it is also visible.
If objToCheck.Exists = True Then
If objToCheck.Visible = True Then
' Do your action here.
End If
End If
Hi
I did the sugestions you give me.
Altought, even when doing all the tests you sugest it didn't solve my problem.
My problem is:
I had a alert window over all my windows.
I do the code to find the active windows (the alert), so I could close it.
However, testcomplete is returning a closed ( and invisible) window.
The software I'm testing is developed with delphi, and the alert is a application.messagebox alert.
I need to close that alert!
Does someone have a idea that could help-me?
The code below doesn't help too.
set wAlertaVenc = Sys.Process("central").WaitWindow("_TForm", "Atenção", 1,1000)
If wAlertaVenc.Exists then
Sys.Process("central").Window("_TForm", "", 1).VCLObject("OK").Click
end if
- AlexKaras10 years agoCommunity Hero
Hi,
.WaitWindow("_TForm", "Atenção", 1,1000) specifies exact unique window of your application. If you see the alert window on the screen, but the window returned by the WaitWindow() function is invisible, this means that more than one alert window exists in the tested application (this can easily be verified with the help of the ObjectBrowser) and the one you are referencing to is hidden at this moment.
Assuming that all alert windows are direct children of the process, I can suggest the following code (untested, of top of my head):
Set wAlertaVenc = Sys.Process("central").FindChild(Array("WndClass", "WndCaption", "Visible"), Array("_TForm", "Atenção", True), 1)
If (wAlertaVenc.Exists) Then
Call wAlertaVenc.VCLObject("OK").Click
End IfDoes this help?