SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2010
    Location
    India
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How does the waitproperty work?


    I have set the Object Synchronization TimeOut - 1 sec

    'Launch the app
    SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe",""," C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
    'Enter Agent Name
    Dialog("Login").WinEdit("Agent Name:").Set "gaurav"
    Dialog("Login").WinEdit("Agent Name:").Type micTab
    'Enter password
    Dialog("Login").WinEdit("Password:").SetSecure "4dfa11562d13bab81a4db7d4b730c24eac83dcab"
    'click on OK
    Dialog("Login").WinButton("OK").Click
    'Wait for Insert Order
    Window("Flight Reservation").WinButton("Insert Order").WaitProperty "text", "&Insert Order", 50000
    'click on Close
    Window("Flight Reservation").Close


    The execution is giving a warning on

    Window("Flight Reservation").WinButton("Insert Order").WaitProperty "text", "&Insert Order", 50000


    However, if I insert a wait 15 before the waitproperty, then the script works fine


    'Launch the app
    SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe",""," C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
    'Enter Agent Name
    Dialog("Login").WinEdit("Agent Name:").Set "gaurav"
    Dialog("Login").WinEdit("Agent Name:").Type micTab
    'Enter password
    Dialog("Login").WinEdit("Password:").SetSecure "4dfa11562d13bab81a4db7d4b730c24eac83dcab"
    'click on OK
    Dialog("Login").WinButton("OK").Click

    'perform hard coded wait for 15 before executing waitproperty
    wait 15
    'Wait for Insert Order
    Window("Flight Reservation").WinButton("Insert Order").WaitProperty "text", "&Insert Order", 50000
    'click on Close
    Window("Flight Reservation").Close

    I am wondering on what actually does the waitproperty do? It should ideally wait for 50 seconds, however it is proceeding and still giving a warning.

    Any thoughts? or experiences?
    Regards
    Gaurav Pandey
    http://www.gauravpandey.co.in/

  2. #2
    Member
    Join Date
    Aug 2008
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    Are you sure the objects exist before your waitproperty? Replace wait 15 with:

    var_exist = False
    Do
    If Window("Flight Reservation").Exist Then
    var_exist = True
    End If
    Loop Until var_exist = True

  3. #3
    Super Member FredMan's Avatar
    Join Date
    Oct 2007
    Location
    Lenexa, Kansas
    Posts
    1,218
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    The WaitProperty method will wait for an object to become visible for the amount of time that you enter but will move on if the object becomes visible earlier. So the line of code, Window("Flight Reservation").WinButton("Insert Order").WaitProperty "Visible", "True", 50000, will wait for 50 seconds for the Insert Order button to become visible but will move on if it becomes visible earlier.
    Onward thru the fog...

  4. #4
    Member
    Join Date
    Mar 2010
    Location
    India
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    [ QUOTE ]
    The WaitProperty method will wait for an object to become visible for the amount of time that you enter but will move on if the object becomes visible earlier. So the line of code, Window("Flight Reservation").WinButton("Insert Order").WaitProperty "Visible", "True", 50000, will wait for 50 seconds for the Insert Order button to become visible but will move on if it becomes visible earlier.

    [/ QUOTE ]

    Thanks, I tried the code snippit you mentioned

    Wait for Insert Order , visible property
    Window("Flight Reservation").WinButton("Insert Order").WaitProperty "visible", True, 50000

    This too is giving a warning!!
    Regards
    Gaurav Pandey
    http://www.gauravpandey.co.in/

  5. #5
    Member
    Join Date
    Mar 2010
    Location
    India
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    [ QUOTE ]
    Are you sure the objects exist before your waitproperty? Replace wait 15 with:

    var_exist = False
    Do
    If Window("Flight Reservation").Exist Then
    var_exist = True
    End If
    Loop Until var_exist = True

    [/ QUOTE ]

    Thanks!! I tried exist. After the QTP has confirmed that Window("Flight Reservation") does Exist then the script is working fine. No Warning.

    Does the object "have to" EXIST for the wait property to work? What if the object does not exist, however will exist before the timeout time has elapsed?
    Regards
    Gaurav Pandey
    http://www.gauravpandey.co.in/

  6. #6
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,557
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    Yes, waitproperty should only be used to detect changes to an object's properties that already exists.

    If it does not it will just use the default object sync timeout so you will not get the behavior you expect in terms of your specified timeout.

  7. #7
    Member
    Join Date
    Mar 2010
    Location
    India
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How does the waitproperty work?

    Thanks! I have clarity now!!
    Regards
    Gaurav Pandey
    http://www.gauravpandey.co.in/

 

 

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.00%
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 08:11 PM.

Copyright BetaSoft Inc.