Basically Short-cut is some kind of privileges provided by any software or service in order to use that software effectively in term of usage. The main purpose of short-cut is to complete your task in minimal time with minimal effort. Quick test is a very big package and sometimes when we develop any automation script through these short-cuts we can save time and development - effort. Just you need to know how and when you can use such short-cuts effectively. So in this article you can find some important and useful short-cuts with their workaround. |
|
1. |
Comment and Uncomment (Ctrl+M and Ctrl+Shift+M) |
Its a good practice to write comments when we are working with code in QTP. but every time to put one apostrophe(' basically used for commenting in QTP) is a tedious job but through Ctrl+M and Ctrl+Shift+M you can comment and uncomment them easily. QTP doesn't support multiline comments so we don't have any procedure to use such commenting.
|
|
2. |
Debugging (F9 Shift+F9 and Ctrl+Shift+F9) Add Watch (Ctrl+T) |
Its very normal when you debug your code and you have to click in debugging command area. If your QTP is not in running state you can simply use mouse to put breakpoint and remove it but during running state it happens lot of time if we click twice in debugging command area, QTP got hang and we have to kill QTPPro.exe process and sometime irritating but these short can help you out here. during your running state just use these short-cut and your QTP will never hang. and as well as you can see add watch with any variable.
|
|
3. |
Step Over(F10), Step Into(F11) and Step Out(Shift+F11) |
Basically these debugging procedures you can find in most of the languages. But if we know to use them we can save lot of debugging time. But to understand these Steps, We need to take a scenario. Suppose we have two function A, B. We are debugging A function. In function A we are calling function B. so StepInto will execute all steps one by one.so you can see complete execution of function B. but StepOver will take complete B function as a unit and run complete function at once. And suppose using StepInto you entered in Function B, That’s the time we can use StepOut to come out from that function(like Step Over). That why We have F11 for StepInto and Shift+F11 for StepOut. And F10 for Step Over.
|
|
4. |
Step generator (F7) |
An automated tool to write code or step for your testcase. If you are not from coding field so this utility can help you much. And from learning prospective you can understand all functions, classes and objects available in QTP. |
|
5. |
Running Script (F5 And Ctrl+F5) |
We can simply run any script using F5 button. But this will be your normal run mode. In QTP we have two more run mode.- Maintenance Run Mode and Update RunMode. We dont have shortcut for them but during development if we use these run mode correctly we can definitely save our time. For Running from Selected Step We can use Ctrl+F5 key. |
|
6. |
Record(F3) Run(F5) and Stop(F4) |
As we already discuss about Run so here we will discuss about Stop(F4) and Record(F3). Stopping a script is something like to break main thread. But there is a hard code rule about it. If your thread in sleep state you can’t do anything until it will not reactive or running status. So you can’t stop your script if your script is in wait() function right now. So to save yourself from such problem. First pause script and then Stop your Script (Pause+F4). Sometimes Pause button doesn’t work so use mouse to click on pause.
In Recording We have three type of Recording
Normal recordingmode(F3):- Default mode of QTP recording. Plays with object identification and smart identification etc. Normally in Descriptive Programming we try to replicate this type of functionality in our own code.
Analog Recording (Shift+Alt+F3):-Record Exact mouse and keyboard movement in relation to screen or the application window. So always keep in mind that during this recording Do not change resolution or never zoom your AUT Window.Eg. Signature etc
Low Level Recording (Ctrl+Shift+F3):- Record objects as window test objects and useful when object not getting recognized by QTP. (this is the last option. When nothing work low level coding is the only option)
We can’t edit Analog Recording but we can edit normal and lowlevel easily. And Always remember during recording no wait comes in calculation. So never analog recording is not a good idea to use for standalone applications.
|
|
7. |
Check Syntax (Ctrl+F7) |
Check Syntax is something like compiling script. Check Syntax is relevant for only function libraries (and QTP tests), and not for components. QTP checks only the associated function libraries that can be accessed. For example, if an associated function library is stored in a Quality Center project to which you are not currently connected, its syntax will not be checked. |
|
8. |
Bookmark in QTP (Ctrl+B) |
Bookmarking is very interesting and useful feature in QTP if you really into development. You can simply create your bookmark and reach your desired part in a quick manner. In a big framework and architecture we can use this feature with more accuracy. |
|
9. |
Add and remove With Block in QTP(Ctrl+W And Ctrl+Shift+W) |
With Block always recommended by all professional because it makes your script fast. But when we have some code with our object hierarchy so it will be tedious job make that according to With Statement. So we can use Ctrl+W block and Ctrl+Shift+W we can remove With blocks. |
|
10. |
Go to Definition (Alt+G) |
Instead of using mouse to reach at function definition we can use Alt+G Shortcut key. |
|
11. |
Zipped Exporting(Ctrl+Alt+S) and Importing(Ctrl+Alt+M) |
Export or import your test is very easy from these Shortcuts. We can easily zip any test using Ctrl+Alt+S and import any test using Ctrl+Alt+M. |
|