SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    What causes the unexpected window error to occur?

    User (kwphipps@statestreet.com.nospam) posted:

    Could someone tell me what causes the unexpected active window error?

    I'm thinking that it is when I've set context on a window and am performing
    some action based on that context and another window appears and has focus.
    Then, after the unexpected window has focus, I try to perform some action
    based on the old context and the unexpected active window gets generated.

    Is this a correct interpretation?

    Thanks,
    Ken Phipps


    ---

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User rjpowers (rjpowers@townisp.com.nospam) posted:

    Yes.

    Rational definition:

    Unexpected Active Window definition

    Any window that is not expected by Robot during playback and that prevents
    the expected window from being made active. For example, it can be an error
    message generated by the application-under-test.
    In many cases, Robot can handle and deactivate an unexpected window based on
    the options in the Unexpected Active Window tab in the GUI Playback Options
    dialog box.

    Richard


  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User (david.marsh@gb.abb.com.nospam) posted:


    Our strategy is like this, we know what window we want to have context on.
    We then find out what window is active, if it is not what we want we try to
    close it, we have a loop and pass a value in to see how many times we are
    going to try to close it. If we cant close the window we shut down the
    application and will restart it. This mirrors what real will users do,
    unexpected window try to close, after a while get fed up and shut the
    application. We have not yet perfected this but we are getting there.

    Dave


    ---

  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User (kwphipps@statestreet.com.nospam) posted:


    Thanks for the info. I have some followup questions:

    I'm using TeamTest 2000 on an NT machine.

    How do you determine what the currentwindow is when you are testing a web
    app with Robot?

    When I've used currentwindow it gives me the Robot window.

    Thanks,
    Ken



    david.marsh@gb
    .abb.com To: "SQA Suite Team Test Users" <sqa-suite-users@lyris.dundee.net>
    cc:
    11/06/2001 Subject: Re: What causes the unexpected window error to occur?
    04:42 AM
    Please respond
    to "SQA Suite
    Team Test
    Users"


    Our strategy is like this, we know what window we want to have context on.
    We then find out what window is active, if it is not what we want we try to
    close it, we have a loop and pass a value in to see how many times we are
    going to try to close it. If we cant close the window we shut down the
    application and will restart it. This mirrors what real will users do,
    unexpected window try to close, after a while get fed up and shut the
    application. We have not yet perfected this but we are getting there.

    Dave


    ---

  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User Aidy Rutter (AidyR@TrustMarque.com.nospam) posted:

    I think this gets the current window
    Declare Function GetForegroundWindow Lib "user32.dll" () As Long
    Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA"
    (ByVal hWnd As Long, ByVal lpString As String, ByVal nMaxCount As Long) As
    Long
    Declare Function GetWindowTextLength Lib "user32.dll" Alias
    "GetWindowTextLengthA" (ByVal hWnd As Long) As Long


    Sub Main
    Dim Result As Integer

    ' Display the title bar text of the foreground window.
    Dim hforewnd As Long ' receives handle of foreground window
    Dim slength As Long ' length of foreground window's title bar text
    Dim wintext As String ' buffer for foreground window's title bar text
    Dim retval As Long ' return value

    hforewnd = GetForegroundWindow() ' determine the foreground window
    slength = GetWindowTextLength(hforewnd) + 1 ' length of its title bar text
    wintext = Space(slength) ' make room in the buffer to receive the text
    retval = GetWindowText(hforewnd, wintext, slength) ' get title bar text
    'wintext = Left(wintext, slength - 1) ' remove null character from end of
    string
    Print "The window "; wintext; " is the foreground window."

    End Sub
    Aidy

  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User Crunk John (ext3jpc) (ext3jpc@ups.com.nospam) posted:

    An unexpected window is what causes the unexpected window error to occur.


    Is this a trick question?

    John


  7. #7
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User (kwphipps@statestreet.com.nospam) posted:


    Sounds like one doesn't it. What I was trying to get at is what
    technically is going on for Robot to recognize a window as unexpected.

    For instance, this might be an explanation ---

    Assumption, the context is set for a particular window. When you perform
    some action, Robot, prior to executing the action, verifies that the window
    in focus is the context window. If it is not then Robot generates the
    unexpected window error.



    "Crunk John
    (ext3jpc)" To: "SQA Suite Team Test Users" <sqa-suite-users@lyris.dundee.net>
    <ext3jpc@ups.c cc:
    om> Subject: RE: What causes the unexpected window error to occur?

    11/08/2001
    01:01 PM
    Please respond
    to "SQA Suite
    Team Test
    Users"



    An unexpected window is what causes the unexpected window error to occur.


    Is this a trick question?

    John


  8. #8
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What causes the unexpected window error to occur?

    User (kwphipps@statestreet.com.nospam) posted:


    Thanks Aidy, I'll try it out. Ken



    Aidy Rutter
    <AidyR@TrustMa To: "SQA Suite Team Test Users" <sqa-suite-users@lyris.dundee.net>
    rque.com> cc:
    Subject: RE: What causes the unexpected window error to occur?
    11/08/2001
    12:46 PM
    Please respond
    to "SQA Suite
    Team Test
    Users"



    I think this gets the current window
    Declare Function GetForegroundWindow Lib "user32.dll" () As Long
    Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA"
    (ByVal hWnd As Long, ByVal lpString As String, ByVal nMaxCount As Long) As
    Long
    Declare Function GetWindowTextLength Lib "user32.dll" Alias
    "GetWindowTextLengthA" (ByVal hWnd As Long) As Long


    Sub Main
    Dim Result As Integer

    ' Display the title bar text of the foreground window.
    Dim hforewnd As Long ' receives handle of foreground window
    Dim slength As Long ' length of foreground window's title bar text
    Dim wintext As String ' buffer for foreground window's title bar text
    Dim retval As Long ' return value

    hforewnd = GetForegroundWindow() ' determine the foreground window
    slength = GetWindowTextLength(hforewnd) + 1 ' length of its title bar text
    wintext = Space(slength) ' make room in the buffer to receive the text
    retval = GetWindowText(hforewnd, wintext, slength) ' get title bar text
    'wintext = Left(wintext, slength - 1) ' remove null character from end of
    string
    Print "The window "; wintext; " is the foreground window."

    End Sub
    Aidy

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.09%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:17 AM.

Copyright BetaSoft Inc.