SPONSORS:






User Tag List

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

    How can i test cursor focused property in TP?

    Here i want to test the Tab order for my application.when i pressed the tab key i want to test that the cursor is moving/focusing to the correct location/field.

    Thanks in advance..

  2. #2
    Advanced Member
    Join Date
    Jan 2002
    Location
    Detroit, Michigan
    Posts
    522
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i test cursor focused property in TP?

    This is an example of what you can do. The trick is to use the <font color="blue">ActiveControl()</font> method of the <font color="blue">Window </font> object.

    <font class="small">Code:</font><hr /><pre>' Generic gui object
    Dim g As TGUIObject

    ' Attach to the dialog and set focus to the window
    Window("Replace Window").Attach
    Window.SetFocus

    ' Get the gui object that has the focus and show it.
    Set g = Window.ActiveControl()
    MsgBox g.AttachName

    ' Type a tab to the window and wait for the focus to change (500ms is half a second)
    Window.Type "{Tab}"
    Pause 500, tpPauseMilliSeconds

    ' Do the same thing again.
    Set g = Window.ActiveControl()
    MsgBox g.AttachName</pre><hr />
    Wrap the whole thing in a function and use TestLog.Comment or UserCheck to report the information.
    //*eggbox

  3. #3
    Senior Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    876
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i test cursor focused property in TP?

    Which version of TP are you using?

    TP can be very tricky with Visual Tests in 6.0 and the tab key. It will execute against an attach to some object types and not to others.
    "I think when you spread the wealth around, it's good for everybody." -- Toledo, Ohio, Oct. 12, 2008

  4. #4
    Junior Member
    Join Date
    May 2007
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i test cursor focused property in TP?

    using TP 5.3

  5. #5
    Advanced Member
    Join Date
    Jan 2002
    Location
    Detroit, Michigan
    Posts
    522
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i test cursor focused property in TP?

    5.3 only has scripts so the sample code should work for you.
    //*eggbox

 

 

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 06:41 AM.

Copyright BetaSoft Inc.