SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2004
    Location
    UK
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How do I create a loop until a certain window appears?

    I am a new user to testpartner and have no experience with VBA

    Im having some problems trying to automate our installation testing.

    We use an installshield wrapper to install out product

    When automating the installshield wrapper, Im having to use wait events to wait for the next installshield window to appear before I can proceed to attach to the next window

    Problems im having with wait events are that these installshield windows can take different times to appear depending on the machine spec and speed of my machine at the time

    What I would really like to do is create a loop that goes round pausing for 1 sec until a certain window or peice of text appears on the screen.

    Im sure this cannot be that hard, ive tried several things with the visual basic help and have had no luck.

    Could somebody please help me achieve this

    Thanks

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I create a loop until a certain window appears?

    It appears Install Shield is built in C, so TP sees its text as Label objects. So do this:


    do until Label("Caption='Select new program components to add or select currently installed components to remove.'",tpAttachNoWait).exists = true

    sleep 5

    loop

    //Get the label attach name using the Identify tool. I would recommend higher sleep intervals then 1 or 2 because when TP is "sleeping" it frees up the processor for your app to use.
    ~Alias~

  3. #3
    Junior Member
    Join Date
    Mar 2004
    Location
    Newcastle upon Tyne, UK
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I create a loop until a certain window appears?

    If you want to do metrics on the response time, you could set PlayBack.AttachTimeout to something a sufficiently long time to pick up the page you want, then set it back to its orignal value.
    E.g.

    Dim origTimeout as int
    origTimeout = PlayBack.AttachTimeout
    PlayBack.AttachTimeout = 60 'E.g. wait up to 1 min
    '***** Try to attach here, if this does not happen before timeout a failure will be logged & the code stopped
    PlayBack.AttachTimeout = origTimeout

    Then you have the added avantage of not having a potentially inifinite loop if the expected screen doesn't turn up.

 

 

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 10.34%
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 04:48 PM.

Copyright BetaSoft Inc.