SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jan 2007
    Posts
    472
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to wait for a window application to get launch

    Hi,

    Although this scenario is not so good, but i have to launch WinRunner from QTP Script and Vice-versa.

    I can do this by using

    SystemUtil.Run "C:\Program Files\Mercury Interactive\WinRunner\arch\wrun.exe"

    But when this line is executed, WR takes sometime to come up, load all add-ins and connecting to QC etc.

    So is there any way to make QTP wait till WinRunner get launched instead of Hard-coding the wait time period?

    Thanks,

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to wait for a window application to get la

    There has to be a certain limit. You can't say that you will idefinitely. So you should decide a time may be 5 min max

    and then use something like

    x=Window("title:=.*Winrunner.*").Exist(60*5)

    if x Then
    'Now
    else
    'Not now
    end if

  3. #3
    Advanced Member KishoreApplabs's Avatar
    Join Date
    Oct 2006
    Posts
    965
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for a window application to get la

    Hi

    we can write one comman resuable functions for this situation like function look like

    Void waitforobject(pass object parameter like(window name))
    {
    i=0
    'Check the object exist or not
    while(i<=180)
    {
    if(window("title").Exists())
    {
    print("Sucessfully find the object")
    retrun value
    }
    i++;
    }
    }

    once the object exists it will come out of the loop by using return stament

    you can call the function like this
    waitforobject(name of the object)

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to wait for a window application to get la

    KishoreQATestEngineer, You are giving an example of QTP in a C/C++ Style?

  5. #5
    Advanced Member KishoreApplabs's Avatar
    Join Date
    Oct 2006
    Posts
    965
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for a window application to get la

    just am giving logic stayle in c/c++ then u can convert same code into the VBS file

 

 

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 11.54%
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 11:45 AM.

Copyright BetaSoft Inc.