Forum Discussion

motorola's avatar
motorola
Contributor
14 years ago

problems with pop up window

I
input a login credential in a login form, and then after clicking log in
button, the app will call a pop up window. there's a slight delay
between clicking button and the pop up appears. the next step in the
test after logging in is to input additional credentials in the
mentioned pop up window. This is where I got "object is missing". Is it
because testcomplete tries to send keyboard input to the popup window
when it's not appeared yet? could you please explain this case and the
solution?

also in
another popup window, I use the alias in an If....Then statement during
test. The funny thing is sometimes the test will say "Unexpected window"
and the entire test stops with an error. When I toggled a breakpoint,
the name of the object becomes something like
Sys.Process("abc").VCLObject("AddForm") instead of Aliases.App.AddForm.
Can you explain this and what's the solution to prevent this problem?

6 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    This all seems to do with adding code to your tests to wait for windows to either appear or disappear before you proceed.  You might want to search for topics in the help concerning "Waiting for Objects" and see what you can find.



    Something that might be helpful is a screenshot of your keyword test or a copy/paste of your script code so we can help.



    As for your naming issues, it has to do with a couple of things.  If an object has been mapped to an alias, you'll see it as just the name.  If it has not, you may see it as VCLObject.
  • here's a video where you can see the error. After OK button, the app will call a pop up window (another form for additional credentials). This problem will go away if I add a delay for about 5 secs just before the highlighted line you can see at the end of the video.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    My suggestion still remains.  You may need to add a "WaitVCLObject" call to wait for the popup window to appear before you go on to the next step.  You may also want to add other such functions.



    The "Unexpected Window" error basically means that your test (keyword or script) is not expecting that popup.  The popup is getting in the way of you doing something else (clicking on a button on another form) and so it's letting you know you can't do anything.



    The solution: 

    1) Add code to "Wait" for the popup window to appear

    2) Do what you need to do to get rid of the pop-up

    3) Continue your code from there.



    The help files built in to TestComplete have a lot about how to handle such situations.  Search for the "Waiting for Object" topic and other related topics.
  • it's happening again. the popup window's name in namemapping is Sys.process("app").VCLObject("frmBrowser1"), while alias made for it is Aliases.app.FormBrowser. I used the alias in the keyword test, but testcomplete always gave Unexpected Window : Sys.process("app").VCLObject("frmBrowser1"). It seems that testcomplete doesn't recognize the alias and only recognizes name in namemapping. What's wrong? thanks
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Can you post a screenshot of your keyword test or paste in your script code, which ever you are using?  
  • Hi,



    As Robert suggested twice, you need to wait for your window and do some actions with it when it appears.



    Also, 'Sys.process("app").VCLObject("frmBrowser1")' is not a name in Name Mapping. It is a regular name shown in the Object Browser. Regarding
    It seems that testcomplete doesn't recognize the alias and only recognizes name in namemapping
    , real object names along with mapped names are always posted to the log when errors occur.