SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How do I hold down the control keys in TestPartner

    I am attempting to hold down the control key and click multiple buttons. However, on playback, it acts like each button clicks with the control key being released afterwards. Is there a way to hold the key down?

    Thanks,
    Wai Man

  2. #2
    Senior Member
    Join Date
    Nov 2005
    Location
    Valley Forge, PA
    Posts
    417
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner



    At the end of the line when you click, add:

    ).Click, tpKeyCtrl

    Joe

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    Thanks. I have tried that but it seems that released control key after it clicked.

  4. #4
    Senior Member
    Join Date
    Sep 2004
    Location
    Toronto, Canada
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    Look into using the windows keyboard event function. You can send a CTRL key down, then do some things, and then send a CTRL key up.

    <font class="small">Code:</font><hr /><pre>
    Private Declare Sub keybd_event Lib "user32" (Byval bVk as Byte, Byval bScan as Byte, ByVal dwFlags as Integer, ByVal dwExtraInfo as Integer)

    const VK_LCONTROL = 162 ' = 0xA2 in hex

    Public Sub press_and_hold_LeftControl()
    keybd_event VK_LControl, 0, 0, 0
    pause 250, tpPauseMilliSeconds
    end Sub

    Public Sub release_LeftControl()
    keybd_event VK_LControl, 0, 2, 0
    pause 250, tpPauseMilliSeconds
    end Sub

    Public Sub press_and_release_LeftControl()
    keybd_event VK_LControl, 0, 0, 0
    pause 250, tpPauseMilliSeconds
    keybd_event VK_LControl, 0, 2, 0
    pause 250, tpPauseMilliSeconds
    end Sub

    </pre><hr />

    More info on keys here (like shift and control, right or left shift or control, etc...

    http://msdn.microsoft.com/en-us/libr...40(VS.85).aspx
    TestPartner:
    Current AUT running test scripts on TP 6.3 build 183, SQL 2000 DB.
    Legacy AUT running on TP 5.6.0 Build 81 and TP 6.2 build 449 with SQL 2000 DB.

    Test Environment:
    TP/IE Clients on VMWare ESX 4.1 server, AUT Servers on VMWare ESX 3.5 server.

    Application Under Test (AUT):
    Client/Server based, IE 7/8 interface with SQL 2005/2008 DB.

    Automating with TP since August 2004.

  5. #5
    Member
    Join Date
    Feb 2007
    Posts
    325
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    I'm not sure if this well work. But when I am breaking out of a windows I use the Ctrl C key.

    In my script its
    Window.Type "{Ctrl C}"

    You should be able to use the type command even with a window.

  6. #6
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    Looks interesting. I'll give this a shot. Thx!!

  7. #7
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    keybd_event works like a champ. Thanks Araknid for your thoroughness.

    Wai

  8. #8
    Junior Member
    Join Date
    Jul 2010
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I hold down the control keys in TestPartner

    Yeah - this was exactly what I needed also, much thanks Araknnid!

 

 

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 9.38%
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:35 AM.

Copyright BetaSoft Inc.