IT Community - Software Programming, Web Development and Technical Support

QTP tips

This is a discussion on QTP tips within the Testing Tools forums, part of the Software Quality Assurance category; The User Retrieve data from database using datatable or Data base checkpoint. -- Sundar Raja...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Quality Assurance > Testing Tools

Register FAQ Members List Calendar Mark Forums Read
  #21 (permalink)  
Old 11-14-2007, 04:08 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Default Re: QTP tips

The User Retrieve data from database using datatable or Data
base checkpoint.

-- Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #22 (permalink)  
Old 11-14-2007, 04:44 AM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

Here are the steps to retrieve data from database

1 Choose Specify SQL statement in the Database Query Wizard screen.
2 Specify the connection string and the SQL statement, and click Finish.
Connection string—Enter the connection string, or click Create to open the ODBC Select Data Source dialog box. You can select a .dsn file in the ODBC Select Data Source dialog box or create a new .dsn file to have the Database Query Wizard insert the connection string in the box for you.
SQL statement—Enter the SQL statement.

Last edited by senthilkannan : 11-14-2007 at 04:48 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 11-15-2007, 02:05 AM
devarajan.v devarajan.v is offline
D-Web Master
 
Join Date: May 2007
Posts: 382
devarajan.v is on a distinguished road
Thumbs up Re: QTP tips

Hi,

Quicktest normal recording mode records the objects in your application and the operations performed on them. This mode is the default and takes full advantage of Quicktest test object model, recognizing the objects in your application regardless of their location on the screen. When working with specific types of objects or operations, however, you may want to choose from the following, alternative recording modes:
Analog Recording - enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. In this recording mode, QuickTest records and tracks every movement of the mouse as you drag the mouse around a screen or window. This mode is useful for recording operations that cannot be recorded at the level of an object, for example, recording a signature produced by dragging the mouse.
Low-Level Recording - enables you to record on any object in your application, whether or not QuickTest recognizes the specific object or the specific operation. This mode records at the object level and records all runtime objects as Window or WinObject test objects. Use low-level recording for recording tests in an environment or on an object not recognized by QuickTest. You can also use low-level recording if the exact coordinates of the object are important for your test.

Regards,
devarajan
__________________
Regards,
devarajan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 11-15-2007, 02:49 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

Recovery Scenario Properties,

> Viewing Recovery Scenario Properties
> Modifying Recovery Scenarios
> Deleting Recovery Scenarios
> Copying Recovery Scenarios between Recovery Scenario Files

Viewing Recovery Scenario Properties

To view recovery scenario properties:

1 In the Scenarios box, select the recovery scenario whose properties you want to view.

2 Click the Properties button . Alternatively, you can double-click a scenario in the Scenarios box. The Recovery Scenario Properties dialog box opens.


Modifying Recovery Scenarios:

You can modify the settings for an existing recovery scenario.

To modify a recovery scenario:

1 In the Scenarios box, select the scenario that you want to modify.

2 Click the Edit button . The Recovery Scenario Wizard opens, with the
settings you defined for the selected recovery scenario.

3 Navigate through the Recovery Scenario Wizard and modify the details as needed.

Deleting Recovery Scenarios:

You can delete an existing recovery scenario if you no longer need it. When you delete a recovery scenario from the Recovery Scenario Manager, the corresponding information is deleted from the recovery scenario file.

Note: If a deleted recovery scenario is associated with a test, Quick Test ignores it during the test run.

To delete a recovery scenario:

1 In the Scenarios box, select the scenario that you want to delete.

2 Click the Delete button . The recovery scenario is deleted.


Copying Recovery Scenarios between Recovery Scenario Files:

You can copy recovery scenarios from one recovery scenario file to another.

To copy a recovery scenario from one recovery scenario file to another:

1 In the Scenarios box, select the recovery scenario that you want to copy.
2 Click the Copy button . The scenario is copied to the Clipboard.

3 Click the Open button and select the recovery scenario file to which you want to copy the scenario, or click the New button to create a new recovery scenario file in which to copy the scenario.

4 Click the Paste button . The scenario is copied to the new recovery scenario file.

Note: If a scenario with the same name already exists in the recovery scenario file, you can choose whether you want to replace it with the new scenario you have just copied.


Setting the Recovery Scenarios List for Your Tests:

After you have created recovery scenarios, you associate them with selected tests so that Quick Test will perform the appropriate scenario(s) during the test runs if a trigger event occurs. You can prioritize the scenarios and set the order in which Quick Test applies the

scenarios during the test run. You can also choose to disable specific scenarios, or all scenarios, that are associated with a test. You can also define which recovery scenarios will be used as the default scenarios for all new tests.

Adding Recovery Scenarios to Your Test:

After you have created recovery scenarios, you can associate one or more scenarios with a test in order to instruct Quick Test to perform the recovery scenario(s) during the test run if a trigger event occurs. The Recovery tab of the Test Settings dialog box lists all the recovery scenarios associated with the current test.

Tip: When a trigger event occurs, Quick Test checks for applicable recovery scenarios in the order in which they are displayed in the Recovery tab. You can change this order as described in “Setting Recovery Scenario Priorities”


Viewing Recovery Scenario Properties:

You can view properties for any recovery scenario associated with your test.

To view recovery scenario properties:
1 In the Scenarios box, select the recovery scenario whose properties you want to view.

2 Click the Properties button . Alternatively, you can double-click a scenario in the Scenarios box. The Recovery Scenario Properties dialog box opens, displaying read-only information regarding the settings for the selected scenario.


Removing Recovery Scenarios from Your Test:

You can remove the association between a specific scenario and a test using the Recovery tab of the Test Settings dialog box. After you remove a scenario from a test, the scenario itself still exists, but Quick Test will no longer perform the scenario during a test run.

To remove a recovery scenario from your test:

1 In the Scenarios box, select the scenario you want to remove.
2 Click the Remove button . The selected scenario is no longer associated with the test.


Enabling and Disabling Recovery Scenarios:

You can enable or disable specific scenarios and determine when Quick Test activates the recovery scenario mechanism in the Recovery tab of the Test Settings dialog box. When you disable a specific scenario, it remains associated with the test, but is not performed by Quick Test during the test run. You can enable the scenario at a later time.


Setting Default Recovery Scenario Settings for All New Tests:

You can click the Set as Default button in the Recovery tab of the Test Settings dialog box to set the current list of recovery scenarios to be the default scenarios for all new tests. Any future changes you make to the current recovery scenario list only affect the current test, and do not change the default list that you defined.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 11-15-2007, 02:58 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

Object Repository:

When a test is recorded, QTP adds each object on which an operation is performed, to the Tools>object repository. Objects can be added to the repository while editing the tests too.While recording, Objects are added to the repository in either of the two ways:

a. Object Repository per Action

b. Shared Object Repository.


a. Object Repository per Action


In the Per-Action mode, objects are identified and separated on the basis of each action and the corresponding object repository for the test is created in the test folder.In the Shared mode, the user may choose a location to save the shared object repository files for all the tests.
All the Objects recorded during a test,and their properties can be seen and manipulated in the Tools>Object Repository.There are provisions in this Object Repository Dialog box to add new objects,spy objects, find and replace property values etc.

b. Shared Object Repository

The second section of the dialog box contains provision to Find, Replace, Add, and Remove the properties of an object in the Repository also set any default values for the properties.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 11-15-2007, 03:08 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Question Re: QTP tips

Hi guys

can anybody explain me in brief about the difference between the Global sheet & Local Sheet in QTP?

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 11-15-2007, 03:15 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Default Re: QTP tips

Each action also has its own sheet in the Data Table so that you can insert data that applies only to that action. When there are parameters in the current action’s sheet, you can set QuickTest to run one or more iterations on that action before continuing with the current global iteration of the test.

The Global sheet contains the data that replaces parameters in each iteration of the test. When you run your test, QuickTest inserts or outputs a value from or to the current row of the global data sheet during each global iteration.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28 (permalink)  
Old 11-15-2007, 03:16 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

Importing & Exporting Datasheet :



Importing Datasheet:

Description :

Imports a sheet of a specified file to a specified sheet in the run-time Data Table. The data in the imported sheet replaces the data in the destination sheet (see SheetDest argument).


Note: All the fields in the imported sheets should match with the data used in the script.

There are two functions for Importing, Importing the whole excel file and Importing the sheets in the file.

Function for Importing the whole Excel file:

Imports the file into the script with all the sheets which are there in the excel file.

Note: Sheets in the excel file should match with the Actions in the script to use the data efficiently, since action name and corresponding sheet name should be same.

Syntax:

Import “filenamewithpath”

Function for Importing the sheets from the excel file:

Imports the specified sheet into the script.

Syntax:

Importsheet “filenamewithpath”,”sourcesheetname”,
”destinationsheetname”



Exporting Datasheet:

Description

Exports a specified sheet of the run-time Data Table to the specified file.

•If the specified file does not exist, a new file is created and the specified sheet is saved.

•If the current file exists, but the file does not contain a sheet with the specified sheet name, the sheet is inserted as the last sheet of the file.

•If the current file exists and the file contains the specified sheet, the exported sheet overwrites the existing sheet.

Same as Importing, There are two functions for Exporting, Exporting the whole excel file and Exporting the sheets in the file.

Function for Exporting the whole Excel file:

Exports the file into the script with all the sheets which are there in the excel file.

Syntax:

Export “filenamewithpath”

Function for Exporting the sheets from the excel file:

Exports the specified sheet into the script.

Syntax:

Exportsheet (“filenamewithpath”,”sourcesheetname”,
”destinationsheetname”)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29 (permalink)  
Old 11-15-2007, 06:26 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

Action Template in QTP :

Creating an Action Template

If you want to include one or more statements in every new action in your test, you can create an action template. For example, if you always enter your name as the author of an action, you can add this comment line to your action template. An action template applies only to actions created on your computer.

To create an action template:

1. Create a text file containing the comments, function calls, and other statements that you want to include in your action template. The text file must be in the structure and format used in the Expert View.

2. Save the text file as ActionTemplate.mst in your <QuickTest Installation Folder>\dat folder. All new actions you create contain the script lines from the action template.

Only the file name ActionTemplate.mst is recognized as an action template
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30 (permalink)  
Old 11-15-2007, 06:38 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

Regular Expressions :


While creating checkpoints we have an option only to search or check for a specific text string or a specific value of a property. To increase the flexibility and adaptability of the tests we use regular expressions.
Regular Expressions enable Quick Test to identify objects and text strings with varying values.

A regular expression is a string that specifies a complex search phrase. By using special characters we define the conditions of the search.

The most common expressions that can be used to create regular expressions are:

1. Using the Backslash Character:

A backslash (\) instructs Quick Test to treat the next character as a literal character, if it is otherwise a special character. The backslash (\) can also instruct Quick Test to recognize certain ordinary characters as special characters.

For example, consider a Web site called:

[mercurytours.mercuryinteractive.com ]


2. Matching Any Single Character:

A period (.) instructs Quick Test to search for any single character (except for \n). For example:

welcome.

matches welcomes, welcomed, or welcome followed by a space or any other single character. A series of periods indicates the same number of unspecified characters.

To match any single character including \n, enter: (.|\n)


3. Matching Any Single Character in a List:


Square brackets instruct QuickTest to search for any single character within a list of characters.

For example, to search for the date 1967, 1968, or 1969, write: 196[789]


4. Matching Any Single Character Not in a List:


When a caret (^) is the first character inside square brackets, it instructs QuickTest to match any character in the list except for the ones specified in the string.

For example: [^ab] matches any character except a or b.


5. Matching Any Single Character within a Range:


In order to match a single character within a range, you can use square brackets ([ ]) with the hyphen (-) character. For instance, to match any year in the 1960s, write: 196[0-9]

A hyphen does not signify a range if it is displayed as the first or last character within brackets, or after a caret (^).

For example, [-a-z] matches a hyphen or any lowercase letter.



6. Matching Zero or More Specific Characters:


An asterisk (*) instructs QuickTest to match zero or more occurrences of the preceding character.

For example: ca*r matches car, caaaaaar, and cr.


7. Matching One or More Specific Characters:


A plus sign (+) instructs QuickTest to match one or more occurrences of the preceding character.

For example: ca+r matches car and caaaaaar, but not cr.


8. Matching Zero or One Specific Character:


A question mark (?) instructs Quick Test to match zero or one occurrences of the preceding character.

For example: ca?r matches car and cr, but nothing else.


9. Grouping Regular Expressions:


Parentheses (()) instruct Quick Test to treat the contained sequence as a unit, just as in mathematics and programming languages.

Using groups is especially useful for delimiting the argument(s) to an alternation operator ( | ) or a repetition operator ( * , + , ? , { } ).


10. Matching One of Several Regular Expressions:


A vertical line (|) instructs QuickTest to match one of a choice of expressions.

For example: foo|bar
causes QuickTest to match either foo or bar.
fo(o|b)ar
causes Quick Test to match either fooar or fobar.


11. Matching the Beginning of a Line:


A caret (^) instructs QuickTest to match the expression only at the start of a line, or after a newline character.

For example: book
matches book within the lines—book, my book, and book list, while
^book
Matches book only in the lines—book and book list


12. Matching the End of a Line:


A dollar sign ($) instructs Quick Test to match the expression only at the end of a line, or before a new line character.


For example: book
Matches book within the lines—my book, and book list, while a string that is followed by ($), matches only lines ending in that string. For example: book$
Matches book only in the line—my book.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #31 (permalink)  
Old 11-16-2007, 11:24 PM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

Working with Netscape in QTP:

Keep the following in mind when using Netscape as your Web browser: Multimedia applications are supported in Internet Explorer only. Do not load the Multimedia add-in if you want to record a test using Netscape.

The Object property accesses DOM objects. These are not supported by Netscape.

Dialog boxes which opened while recording in Netscape are not displayed in the Active Screen.

You can record only the following objects on dialog boxes opened while recording in Netscape:
button
check box
edit—You cannot apply a checkpoint to or use the Object Spy on an edit
object recorded in a dialog box.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #32 (permalink)  
Old 11-19-2007, 06:06 AM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

Uses of XML checkpoints:

You can use an XML file checkpoint to validate that the data has not changed from one application release to another.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #33 (permalink)  
Old 11-19-2007, 06:08 AM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 11-19-2007, 06:09 AM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #35 (permalink)  
Old 11-19-2007, 06:11 AM
senthilkannan senthilkannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
senthilkannan is on a distinguished road
Default Re: QTP tips

You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #36 (permalink)  
Old 11-20-2007, 02:37 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

How to Start recording using QTP?

Choose Test > Record or click the Record button.
When the Record and Run Settings dialog box opens to do this;
1. In the Web tab, select Open the following browser when a record or run session begins.
2. In the Windows Applications tab, confirm that Record and run on these applications (opened on session start) is selected, and that there are no applications listed.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #37 (permalink)  
Old 11-20-2007, 02:37 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

How to Save your test using QTP?

Select File > Save or click the Save button. The Save dialog box opens to the Tests folder.

Create a folder which you want to save to, select it, and click Open.

Type your test name in the File name field.

Confirm that Save Active Screen files is selected.

Click Save. Your test name is displayed in the title bar of the main QuickTest window.

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #38 (permalink)  
Old 11-20-2007, 02:38 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

How to Run a Test using QTP?

1 Start QuickTest and open your test.

If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.

. If the Welcome window opens, click Open Existing.
. If QuickTest opens without displaying the Welcome window, choose File > Open or click the Open button.
In the Open Test dialog box, locate and select your test, then click Open.

2 Confirm that all images are saved to the test results.
QuickTest allows you to determine when to save images to the test results.

Choose Tools > Options and select the Run tab. In the Save step screen capture to test results option, select Always.

Click OK to close the Options dialog box.

3 Start running your test.

Click Run or choose Test > Run. The Run dialog box opens.
Select New run results folder. Accept the default results folder name.
Click OK to close the Run dialog box.

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #39 (permalink)  
Old 11-20-2007, 02:39 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

How to open a new test using QTP?

1. If QuickTest is not currently open, choose Start > Programs > QuickTest Professional > QuickTest Professional. If the Welcome window opens, click Blank Test. Otherwise, choose File > New, or click the New button. A blank test opens.

2. . If QuickTest is already open, check which add-ins are loaded by selecting Help > About QuickTest Professional. If the Web Add-in is not loaded, you must exit and restart QuickTest. When the Add-in Manager opens, select the Web Add-in, and clear all other add-ins. Choose File > New, or click the New button. A blank test opens.

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #40 (permalink)  
Old 11-20-2007, 02:40 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Post Re: QTP tips

How to do Laod testing for web based Application?

1. Recording a scenerio in QTP of my web based application.
2. Make 100 copies of that scenerio and run the test (scenerio run for 100 times)
3. In that case, do the load of application on server.
4. The basic logic of running the copy 100 times is to create same scenerio as if 100 users were working.

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:00 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.