SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2000
    Location
    CA
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Capturing Pop-up window

    This is my problem. I want to do the same action multiple times so I have a loop. After each action, a pop-up window appears that says "In progress." After the "In Progress" window disappears, I want to repeat the same action. How do I capture the pop-up window?

    Initially, I put in a sleep() for every execution in the loop. However, I have noticed that, as soon as I created more than 100 instances, it slows down my machine and therefore, my test case fails since my sleep time is messed up. I was thinking of using the Cursor methods but that didn't work out for me. Do you know of any alternatives or workarounds to this problem? Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    Waltham, MA
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Capturing Pop-up window

    You could use a while loop around a sleep statement, to wait for that In Progress window to appear. It might look something like:

    while (!InProgress.Exists())
    sleep (1)

    This will sleep until the In Progress window exists. The ! basically turns the Exists method into a Does Not Exist method.

  3. #3
    Member
    Join Date
    Jun 2000
    Location
    CA
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Capturing Pop-up window

    Thanks. I had thought about this but my problem was I couldn't do window declare on the "In Progress" window. It is simply just a message box without any title captions at all.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Capturing Pop-up window

    Just because a window doesn't have a caption, it doesn't mean that SilkTest can't recognize it.

    It depends what kind of application you are testing -- Web ?, Java ? C++ ?

    You can look for a window with tag "*" that has the correct "parent".

    Another approach is to use GetChildren() to see when the box goes away:

    InitialWindowCount = ListCount( MyMainWin.GetChildren() )

    while ListCount( MyMainWin.GetChildren() ) == InitialWindowCount
    sleep( 1 )

    on you main window.
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  5. #5
    Member
    Join Date
    Jun 2000
    Location
    CA
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Capturing Pop-up window

    Thanks for the inputs. I got some ideas from your posts. I realized that the messagebox is automatically captured when I created my test frame. What I did was to just added a while loop after every action I wanted to be repeated.
    while (MessageBox.Exists())
    Sleep (1)
    Thanks!

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Capturing Pop-up window

    Don't forget to put a "timeout" in your while loop. If the "in progress" message box never appears (for whatever reason), your script will enter an infinite loop.

    Try something like:


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 02:02 PM.

Copyright BetaSoft Inc.