You are on page 1of 10

1/15/2014

QTP useful tips | Search A Reply

SEARCH...

Search

Search A Reply

Navigation Technology Software Social Media Contact Us


TechnologySoftwareSocial MediaContact Us

Search for:

QTP useful tips


By Lucy | on Mar 5, 2013 | 1 Comment Software

Search

Who's Online
5 visitors online now 2 guests, 3 bots, 0 members

http://www.searchareply.com/qtp-useful-tips/

1/10

1/15/2014

QTP useful tips | Search A Reply

QTP

Best Practices:

1. Use comments liberally. It is helpful in every section to identify what is being done and how you intend to do it. This makes it much easier for other people to understand what the test intends to do.2. FN, LN etc are not good variable names. Absolutely avoid the use of such variable names as i, j, k. 3. It is always a good idea to define your variables at the top of your test and specify what type of data you intend to store into them. 4. Use mixed case or camel case for naming the variables. It becomes easy to read the variables. E.g.
D i ms t r F i r s t N a m e' S t o r e st h en a m e

The Msgbox function should absolutely never be in a test. An automated test is designed to run with unattended execution. Using this function pauses the test and waits for user interaction. If you want to preserve log messages during your test, try the Reporter.ReportEvent method. 5. Never use the Inputbox function in a test. Your data should always be either Hard-coded Simple but not flexible Parameterized Best option since your datatable is editable through any spreadsheet tool. 6. Always indent your code. The interpreter does not care if you dont indent but humans do. Dont forget that during the lifetime of your code, someone else may be charged with updating it. Without proper indentation, it is difficult to figure out what the code below is doing:
http://www.searchareply.com/qtp-useful-tips/ 2/10

1/15/2014

QTP useful tips | Search A Reply

Do while SomeCondition If TestCondition=1 Then MsgBox Passed-1 If TestCondition=2 Then MsgBox Passed-2 End If Else MsgBoxFailed End If Loop The following is easier to read: Do While SoneCondition If TestCondition=1 Then MsgBox Passed-1 If TestCondition=2 Then MsgBox Passed-2 End If Else MsgBoxFailed End If Loop Get Benefited in QTP Using 12 keyword view tips from HP: 1. The Operation item appears in the Keyword View only when functions are defined in function library files associated with the components application area. 2. NEW!! You can manage the availability of keywords used to create keyword-driven components using the new Keywords pane in the application area of QuickTest Professional. 3. When adding a new step using the Keyword View or Step Generator, you can select a new object from your application and it is automatically added to your object repository. 4. You can specify which columns you want to display in the Keyword View. Choose Tools > View Options or right-click any column header in the Keyword View. 5. You can specify the order in which columns are displayed in the Keyword View. Choose Tools > View Options or drag a column header to a new location in the Keyword View. 6. You can print the contents of the Keyword View to your Windows default printer, or preview it on screen before printing. Click the Print button or choose File > Print. 7. You can copy and paste or drag and drop steps in order to move them to a different location within the Keyword
http://www.searchareply.com/qtp-useful-tips/ 3/10

1/15/2014

QTP useful tips | Search A Reply

View. 8. You can enter a comment about a step in the Keyword View by clicking in the Comment cell. You can also enter a comment on a new line below the currently selected step by choosing Insert > Comment. 9. You can view the Documentation column in the Keyword View to read a summary of what the step does, in an easy-to-understand sentence. 10. NEW!! You can copy the content of the Documentation column to the Clipboard by right-clicking any column header in the Keyword View and choosing Copy Documentation to Clipboard. 11. The list of Utility objects available when you open the Step Generator from the Keyword View is a sub-group of the list available when you open the Step Generator from the Expert View. 12. You can print a single action or business component from the Keyword View (in table format) or the from the Expert View (in statement format).

QTP Expert view : 7 tips from HP you should know about: 1. The list of Utility objects available when you open the Step Generator from the Keyword View is a sub-group of the list available when you open the Step Generator from the Expert View. 2. You can print a single action or business component from the Keyword View (in table format) or the from the Expert View (in statement format). 3. When you type VBScript keywords in the Expert View, the relevant VBScript syntax or blocks are added to the test script. 4. You can now locate specified text strings in the Expert View, and replace them with text strings that you specify. You can search for literal text or use advanced options to fine-tune your search. 5. NEW!! You can select a block in the Expert View and press CTRL + M to comment this block. Press SHFT + CTRL + M to uncomment the block. 6. NEW!! You can select a block in the Expert View and indent or outdent it by clicking the Indent or Outdent toolbar buttons. 7. You can call methods and retrieve and set COM object properties from the Expert View using the Object property.

QTP Panes related tips from HP: 1. NEW!! You can control the layout of the QuickTest Professional Window by dragging and dropping panes to a dockable, floating, and tabbed mode.
http://www.searchareply.com/qtp-useful-tips/ 4/10

1/15/2014

QTP useful tips | Search A Reply

2. NEW!! To move a dockable pane without snapping it into place, press CTRL while dragging it to the required location. 3. NEW!! To auto-hide all the tabbed panes, select the title bar of the active tabbed pane, right-click and choose Auto Hide.

HP Tips on QTP Recroding Modes: 1. To stop an analog step in the middle of a test run, click Ctrl + Esc, then click the Stop toolbar button. 2. To record keyboard input, mouse clicks, and the exact path the mouse travels, switch to Analog Recording mode or Low Level Recording mode. 3. You can use the Advanced Windows Applications Options dialog box to modify how QuickTest records and runs tests on Windows applications. Choose Tools > Options > Windows Applications tab > Advanced. 4. You can configure how QuickTest records events in Web applications. Choose Tools > Web Event Recording Configuration. 5. You can record a test on one version of Microsoft Internet Explorer and then run it on other browsers or versions.

QTP Object repository (OR) Tips from HP : 1. The Select Object for Step dialog box enables you to select a new object from your application. If you select an object in your application that is not in the object repository, the object is added to the object repository when you insert the new step. 2. You can run your test in Update mode to update values in your test or business component. You can choose to update checkpoint data, Active Screen images, and/or the descriptions of the objects in the object repository. Choose Automation > Update Run Mode. NEW!! You can associate shared object repositories with multiple actions simultaneously, using the Associate Repositories dialog box. 3. NEW!! You can resolve missing resources (such as missing object repositories and actions), using the new Missing Resources pane. 4. NEW!! You can now associate multiple object repositories with an action or application area. In previous versions of QuickTest Professional, you could associate only a single object repository with a test asset. 5. NEW!! You can export object repository content to an XML file and import a new object repository from an XML file. 6. NEW!! You can copy objects from a shared object
http://www.searchareply.com/qtp-useful-tips/ 5/10

1/15/2014

QTP useful tips | Search A Reply

repository to the local object repository in order to modify them. 7. NEW!! You can use the Object Repository Merge Tool to merge objects from two shared object repositories into a single object repository. 8. You can add new objects to the Object Repository from the Active Screen or using the Add Objects option in the Object Repository dialog box and pointing to the object in your application.

QTP Check points 7 tips from HP: 1. To transfer control to the application while spying or inserting checkpoints on objects, press the CTRL key. 2. You can check the content of an image in a Web page when you create an image checkpoint using the Compare Image Content option. 3. To modify the text used for a text checkpoint, click the Configure button in the Text Checkpoint Properties dialog box. 4. You can add logic to a checkpoint by using a Data Table formula. 5. If it takes time for an object you are checking to load all of its data, you can increase the checkpoint timeout. 6. If you want to create a bitmap checkpoint of multiple objects, select the object in the Object Selection dialog box that includes all the objects you want your bitmap checkpoint to contain. 7. You can run your test in Update mode to update values in your test or business component. You can choose to update checkpoint data, Active Screen images, and/or the descriptions of the objects in the object repository. Choose Automation > Update Run Mode.

QTP 17 General tips from HP: 1. NEW!! You can check syntax errors by clicking CTRL +0 F7. If your script contains errors you can view them in the new Information pane. Like 2. You can export test results to an HTML file to easily view the test results when you are not working in a 0 QuickTest environment. 3. To maximize performance, load only the add-ins Tw eet you need. 4. You can define a recovery scenario to handle 0 unexpected behavior during your run session. 5. You can insert XML output values to your script. 6. You can verify that your XML is structured according to a specific schema. 7. You can create multiple application areas to suit
http://www.searchareply.com/qtp-useful-tips/ 6/10

1/15/2014

QTP useful tips | Search A Reply

different components. 8. NEW!! Business components associated with an application area use only the resources and settings W P Socializer A akash W eb that are defined in the application area. In previous versions of QuickTest Professional, business components could have custom settings. 9. If you need to recover Active Screen files after you save a test without Active Screen files, re-record the necessary steps or use the Update Run option to recapture screens for all steps in your test. 10. You can use a PathFinder.Locate statement in your test to retrieve the complete path that QuickTest uses for a specified relative path based on the folders specified in the Folders tab. 11. By default, in order to conserve disk space, QuickTest does not save screen captures with your test results for steps that pass. You can change the default setting in the Tools > Options > Run tab. 12. The Active Screen loads faster if you clear the Load Images check box in the Web Page Appearance dialog box (Tools > Options > Active Screen tab > Advanced button). 13. From QuickTest, you can run WinRunner tests and call TSL functions in compiled modules. The results of the WinRunner test or function are integrated into the QuickTest test results. 14. You can define custom environment variables for use in your test. 15. You can set a parameter to use a random numeric value. 16. You can use the Window Script Host and the VBScript Runtime Library to further extend your test. For more information choose Help > QuickTest Professional Help > VBScript Reference. 17. You can write automation scripts to control virtually every QuickTest feature and capability using the objects, methods, and properties included in the QuickTest Professional automation object model. 7 Useful tips on Object Identification from HP: 1. You can use the Object Identification dialog box to configure the way QuickTest learns and recognizes objects. 2. You can teach QuickTest to recognize any area of your application as an object by defining it as a virtual object. 3. NEW!! When you rename a test object, you can choose whether to automatically update all occurrences of the test object, or manually change the names in steps that use the renamed test objects. 4. Test object and method names are not case sensitive. 5. To instruct QuickTest to wait for an object to open or appear during test run, use an Exist or Wait statement.
http://www.searchareply.com/qtp-useful-tips/ 7/10

1/15/2014

QTP useful tips | Search A Reply

6. You can set breakpoints in your test, and then use the Debug Viewer pane to view, set, or modify the current value of objects or variables. 7. You can create a user-defined function and register it as a test object method in order to overwrite or add to existing test object functionality. Share this story:
Tw eet Like 0 0 0

Tags: best practicesQTPQTP Keyword viewQTP materialQTP TipsQTP tutorialsUseful tips

Recent Posts

Related Posts

Youtube to bring in offline video viewing feature


Oct 3, 2013 - 0 Comment

QTP Interview Questions Part II


Mar 10, 2013 - 0 Comment

An app to remember your dreams


Oct 3, 2013 - 0 Comment

QTP Descriptive Programming (DP) Soon Mobiles will Predicts the Earthquakes
Oct 3, 2013 - 0 Comment
http://www.searchareply.com/qtp-useful-tips/ 8/10

Mar 5, 2013 - 0 Comment

1/15/2014

QTP useful tips | Search A Reply

QTP Interview Questions Part I


Mar 5, 2013 - 1 Comment

Author Description

One Response to QTP useful tips

1. April 22, 2013 radha Reply is it possible to create scripted component using multiple application area(BPT framework)

Leave a Reply
Your email address will not be published. Required fields are marked * Name * Email * Website Comment

http://www.searchareply.com/qtp-useful-tips/

9/10

1/15/2014

QTP useful tips | Search A Reply

Post Comment

Notify me of follow-up comments by email. Notify me of new posts by email.

Home Contact Us Homepage 2013. All Rights Reserved. Search A Reply

http://www.searchareply.com/qtp-useful-tips/

10/10

You might also like