SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Possible to bind scripts to keys?

    Part of an application that I test has actions that we frequently need to manually test. So QTP can be very useful to perform some of these routine checks and make sure that the numbers match up with that they should be.

    What I'm wondering is if it would be possible to create a bunch of scripts (which I already have working actually), and then bind some of these scripts to different keyboard commands somehow. So say I was on one of the pages on the application I'm testing, and I want to perform the routine that I've binded to ctrl-1 or something, and then it runs that script.

    Is this possible? Or do I just have to have to test open and run it the regular way?

  2. #2
    Member
    Join Date
    Oct 2003
    Location
    Norfolk, VA
    Posts
    360
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Possible to bind scripts to keys?

    I don't know about binding a script to a key, but you could create a batch file that implemented a script and put a link to it on the desktop and just click that link. Do a search of help and forum for "Application Object"
    A good rule of thumb is to never measure with your thumb.

  3. #3
    Senior Member
    Join Date
    Apr 2007
    Posts
    1,005
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Possible to bind scripts to keys?

    Also, desktop shortcuts can have a hotkey specified, so there you go.

  4. #4
    Junior Member
    Join Date
    Jan 2008
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Possible to bind scripts to keys?

    Hmm, but there's no way to make the use the quicktest scripts like this then?

    Like say I made a quicktest test that enters in a value in a box, and checks if the calculation in right, and I have to do this very often so it would be neat to be able to call it with a shortcut rather than having to click the play button in QTP. So no way to do this?

  5. #5
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Possible to bind scripts to keys?

    You probably can do the sorts of things you want to do in a WSH script. And QTP can be called from a WSH script using the Automation Object Model (AOM). Search the forum and read online Help to learn more.

  6. #6
    Senior Member
    Join Date
    Jun 2007
    Location
    IL, US
    Posts
    408
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Possible to bind scripts to keys?

    You can create a .vbs file with the following code and assign a hot key to the vbs file if you have a microsoft keyboard. go through http://support.microsoft.com/kb/237179

    'Create QTP object
    Set objQTPApp = CreateObject("QuickTest.Application")
    objQTPApp.Launch
    objQTPApp.Visible = True

    'Open the Test
    strTestScript = "C:\Test_Script1"
    objQTPApp.Open strTestScript

    'Stop the test when an error occours
    objQTPApp.Test.Settings.Run.OnError = "Stop"

    'Create the results path and the Test Results object
    StrQTP_Res = strTestScript & "\" & "Temp Results"

    Set objTestResults = CreateObject("QuickTest.RunResultsOptions")
    objTestResults.ResultsLocation = strQTP_Res

    'Run the test
    objQTPApp.Test.Run objTestResults

    'Close Qtp
    objQTPApp.Test.Close
    Set objTestResults = Nothing
    Set objQTPLibraries = Nothing
    Set objQTPApp = Nothing

    I don't know how to assign a hot key form any other keyboards. I believe there are some third party tools to assign hot keys to a particular program Search the internet.

 

 

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 05:02 PM.

Copyright BetaSoft Inc.