• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)


Date: Thursday, 27 Oct 2011 10:56
The following code will add a comment in a particular cell in excel worksheet.

Set oExcel=CreateObject("Excel.Application")

oExcel.Visible=True

Set oWorkBook=oExcel.Workbooks.Add

Set oWorkSheet=oWorkBook.Worksheets(1)

With oWorkSheet.Cells(1,1).AddComment

.Visible = False

.Text "Comment for Cell 1,1"

End With

In case, you want to update the comment, use the following code:

With oWorkSheet.Cells(1,1).Comment

.Visible = True

.Text "Comment Text Changed"

End With
Author: "Shruti (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Friday, 23 Oct 2009 00:01
Yesterday I got an email from one of my esteemed readers who asked "Is there any way to deselect all radio buttons using HP QTP?" I thought why one would do that but since it has been asked, it has to be answered.

Before answering the above question let me explain that, radio buttons work in groups unlike checkboxes. It means, in a group only a single radio button can be selected. Afterwards, its not possible to deselect all radio buttons in that group. Even manually it can not be done.

Inititally the task seems impossible but its not :)

It is definitely possible to deselect all radio buttons using QTP but it can only be achieved with the help of Document Object Model or DOM.

The QTP Script for the same goes here:

Set Obj = Browser("Google").Page("Google").object.getElementsByTagName("INPUT")

For each RadioBtn in Obj
If lcase(RadioBtn.type) = "radio" Then RadioBtn.checked = False
Next

To know more about the Document Object Model in QTP, see here : http://msdn.microsoft.com/en-us/library/ms533043(VS.85).aspx

Also read about the Object property in WebRadioGroup Object in QTP help for more information.

Note:

Document Object model is supported by Internet Explorer browser only & not for Firefox as the underlying COM technology is not supported by Firefox. Hence, for Firefox browser, QTP will not be able to access the radio buttons using Document Object Model.

Also working with Document Object Model inside HP Quicktest Professional is faster in terms of performance as no object identification is involved.

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Tuesday, 06 Oct 2009 00:12
I was playing with the excel application along with QTP when suddenly I thought of adding a hyperlink inside an Excel spreadsheet from Quicktest. Task seemed a bit tricky initially but I took up the challenge and finally created a script.

The QTP script to accomplish the same goes here:

'Create an object reference to Excel. Also you can see "Excel.exe" 'process gets created in the Task Manager
Set objExcel = CreateObject("Excel.Application")

'Make the invisible Excel application visible
objExcel.Visible = True

'Add a workbook to the blank excel sheet
Set objWorkbook = objExcel.Workbooks.Add

'Get the handle of first sheet
Set objWorksheet = objWorkbook.Worksheets(1)

'Enter the value in A1 cell inside your first worksheet
objWorksheet.Cells(1, 1) = "QTP Expert"

'Create a range encompassing only the single cell A1
Set objRange = objExcel.Range("A1")

'Add a hyperlink to that range. Here range is only a single 'cell so hyperlink would be created
Set objLink = objWorksheet.Hyperlinks.Add _
(objRange, "http://www.quicktesthp.blogspot.com")

________________________________________________________________
If you like this Article, I would suggest you to subscribe my RSS feed. This way you will get all new future articles directly into your mailbox.
________________________________________________________________
Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Tuesday, 06 Oct 2009 00:04
As the name implies, the "Crypt" object in HP Quicktest Professional is for encrypting the strings which can only be understood by QTP's "SetSecure" method. "Encrypt" is the only method supported by the QTP "Crypt" object.

The syntax is:

Crypt.Encrypt(Your String)

An example for the same would be:

'The string "ExpertQTP" would be encrypted

var=Crypt.Encrypt("ExpertQTP") msgbox var

The output of the above code would be "4ac6e9ba26cad2886bf331a767bfa1ce055f68e66bed5d61". As you can see, this string is encrypted which cant be understood by anyone.

Please Note: Recording on password protected fields automatically encrypts your string for example

Browser("micclass:=Browser").Page("micclass:=Page").
WebEdit("name:=Password").SetSecure "4ac6e9ba26cad2886bf331a767bfa1ce055f68e66bed5d61"


Now lets see how to decrypt our string. Sounds Interesting.. Alright!! Lets read more.

Open your Internet Explorer browser and navigate to Google homepage. Copy and paste the below mentioned script in your QTP editor and run it.

Browser("micclass:=Browser").Page("micclass:=Page").
WebEdit("name:=q").
SetSecure "4ac6e9ba26cad2886bf331a767bfa1ce055f68e66bed5d61"

The output of the above code would be:

As you can see, you can even use SetSecure method on non password fields as well.

Another example of Crypt usage would be to create a function inside a Library and call inside your QTP Script.

pwd="QTPExpert"
Print Crypt_Func(pwd)

'The below function is there in the Library

Function Crypt_Func(password)
Crypt_Func=Crypt.Encrypt(password)
End Function

I am going to present you another example how we can encrypt a string: Using "Mercury.Encrypter"

Set var=CreateObject("Mercury.Encrypter")
Msgbox var.Encrypt("QTP")
Set var=Nothing 'Release the Object reference

Do you think of any other method or Utility to encrypt Strings? If your answer is No, then let me tell you there is a small utility program provided by QTP for encrypting strings. Its "Password Encoder".

How do I access this "Password Encoder" now? Thats simple!!
Navigate to Start-> All Programs-> QuickTest Professional-> Tools-> Password Encoder

Provide your string inside the "Password" field and click on the Generate button. Your encrypted string would be displayed inside the "Encoded String" field.

________________________________________________________________
If you like this Article, I would suggest you to subscribe my RSS feed. This way you will get all new future articles directly into your mailbox.
________________________________________________________________
Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Tuesday, 17 Feb 2009 00:14
Did you ever thought of including some predefined statements in every new test inside your QTP software?

If your answer is yes, then please read on.

You can accomplish this through Action Templates.

Let me present a very simple example to clear this. You want to get your name as the Author of the Action in every new test which means on opening a new test, your name would be displayed by default.

A sample template would be like:

'***********************************************************************
'@Author:
'@Name:
'@Description:
'***********************************************************************

You will notice that above shown template is fully commented out. Also, the Action Template applies to all the actions created on your own computer.


Now lets see how do we create an Action Template inside HP Quicktest Professional(QTP).

Creating Action Template inside HP QTP:

Open the notepad application and copy the above mentioned code inside the notepad. Save the file with this name “ActionTemplate.mst”. Please take care of adding the double quotes while saving the file in the Save as dialog box. Navigate to the path where your Quicktest Professional software is installed. Search for a “dat” folder inside it and save the above mentioned file inside the “dat” folder.


The hierarchy would be
QuickTest Installation Folder\dat folder


After saving this file all new actions would contain the script lines from the Action Template saved just now.

Note that only the name “ActionTemplate.mst” would be recognized as an action template. It means if you change the file name to “ActionTemplate1.mst”, it would not work.

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 07 Jan 2009 18:47
I take an opportunity of sharing my discovery of a new Bug in QTP with my esteemed readers. I discovered it while doing an Analog recording.

Prior to the explanation of the bug let us see the overview of the Analog Recording process according to the QTP 9.2 help file.

According to the "Guidelines for Analog and Low Level Recording" section in the QTP 9.2 help file, you will find that there are two types of Analog Recording modes:

1. Record relative to the screen
2. Record relative to a specified window

Record relative to the screen option is used when you intend to perform operations on objects in either a moving window or if you have objects across multiple windows. Also, the HP Quicktest Professional (QTP) Software captures only the Active Screen image of the final state of the window, which you just recorded.

Record relative to a specified window is used when you intend to perform operations on objects which are present in a single window only. Also HP QuickTest Professional does not capture any Active Screen images in this case.

Now coming back to the bug which happens to be the most funny part as well. The event happens to occur the other way round in case of capturing the Active screen images. What actually happens is that QTP is capturing the Active Screen image in case of "Record relative to a specified window" option as against for "Record relative to the screen" option.

The illustration of the bug goes like this: Let us go by a very simple example being presented herewith.

Open the Command prompt by navigating to Start->Run. Type "cmd" and press the return key.

After opening the command prompt, please follow the below mentioned steps to reproduce this error.

Step – 1: Click on the record button inside QTP and then Click on the "OK" button on "Record and Run Settings" dialog box.

Step – 2: After executing Step1, Analog recording button must be activated in the Automation toolbar. Click on the Analog Recording button. You will see the following screen:

Photobucket

Step – 3: Keep the default option "Record relative to the screen" option selected and click on the "Start Analog Record" button.

Step – 4: Move your mouse inside the command prompt window and click anywhere inside it to make this window active and type any text for example "xyz".

Step – 5: Stop the recording by clicking on the "Stop" button inside QTP.

Step – 6: Click on View->Active Screen.

Now as per the HP Quicktest Professional Help file, the active screen should be displayed. Whereas the Output what I got is shown in the following screen shot with nothing in the Active Screen.

Photobucket

Pretty interesting, I must say.

Now lets try the above mentioned steps for "Record relative to the following window" option.

Execute all the above Six steps as it is, however, execute the Step - 3 in the following manner:

#####################################

Alternative way of Step – 3:

"Check the "Record relative to the following window" radio button and click on the hand icon on the right. Your cursor will change to a hand.

Now move this hand to the title bar of the command prompt and click on it.

With this step, QTP captures the command prompt title as shown in the following screenshot.

Photobucket

Click on the "Start Analog Record" button.
#####################################

After executing the above-mentioned steps, I got the following result as shown in the following screenshot.

Photobucket

This is the expanded view of the above screenshot:

Photobucket

Photobucket


Bug confirmed, Hence proved :)

How about reporting this bug to the HP customer support? Whose gonna take the initiative?

Being Technology Savvy, I am sure you must be curious to read many more interesting articles on QTP; How about subscribing to my Feed? This will help you in automatically knowing the moment I post an article on my Site.

So let us join and let us Learn & Master the great Tool QTP.

Tags: HP QTP, Quicktest Professional, QTP Blog, QTP Bug, Bug inside QTP

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Sunday, 04 Jan 2009 22:29
The beauty of Automation Testing is that Scripts are run in an unattended mode.Thus, what people usually do is, prepare the batch of scripts and leave for their homes. After the batch gets over, no matter even if it passes or even get failed, the PC is unlocked inviting others to view your secret project related data.

This remains a small issue in a simple project based company. However it can become extremely devastating issue in case of a company having Finance or Banking related projects, having top most concern for the security of its data.

So one wonders as to what can be the way by which this situation can be tackled?

I had been scratching my head to device a way to lock my PC automatically after my scripts get executed?

Ultimately I cracked the hard nut by a simple way. Now lets see how..

You can use the following QTP Script to lock your PC :

Set obj = CreateObject("WScript.Shell")
sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
obj.Run sCmnd, 0, False

The above QTP script will lock your PC automatically. Moreover, I will suggest you to create this script as a separate script and call this script lastly in your batch. This will solve the purpose.

Being Technology Savvy, I am sure you must be curious to read many more interesting articles on QTP; How about subscribing to my Feed? This will help you in automatically knowing the moment I post an article on my Site.

So let us join and let us Learn & Master the great Tool QTP.

Tags: HP QTP, Quicktest Professional, lock PC using QTP

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 31 Dec 2008 21:46
It is quite obvious that to be a successful practitioner of QTP, one needs to thoroughly understand Vbscript.

I am presenting below my first article cum tutorial in this series on VBscript, which is a step-by-step guide for all enthusiasts eager to learn QTP.

***********************
VBScript:

Vbscript is a scripting language developed by Microsoft. It is the simplified version of Visual Basic. It is very closely related to BASIC programming language.

What is a Variable?

A variable is a container in the computer’s memory which is used to store information that you want to store. It is possible to change the value of the variables inside your script. In VBScript, all variables are of one fundamental datatype: Variant which means it can store different types of data.

Naming conventions for Variables

While creating variables, you need to follow some rules. These are:
  • They should always begin with a letter and they should not contain a period(.) sign.
  • Variable names should not exceed 255 characters.
  • They should be unique in the scope in which they are declared.
  • They should not have names same as keywords like “Dim”, “For” etc.
How can I create variables with the above knowledge?

Variables can be created using Public, Private or Dim statements. The most common statement is Dim.

For an example, you can use the following syntax to declare variables.

###########
Dim var
###########

Initially this variable has no value which means its empty. After initializing a variable and assigning a value like in above case, the following expressions will evaluate to True:

If var = 0 Then
If var = “” Then

You can also create variables even without using Dim statement however it is not recommended to do so. Following example will clarify the concept:

Dim A
A=B+C

Is there any way to use keywords as variable names?

Yes, there is a way. Through this way we can even use keywords or some special symbols as variable names. Lets see, how it done. For this, you have to place variable names inside brackets.

Dim [For]
[For] = 20
Msgbox [For]

Here, we created a variable named [For] inside brackets which is not possible otherwise. Now the “Msgbox” is a predefined function inside VBScript which is used to display a dialog box to see the value of the variable. The output of the code is:


What is Option Explicit statement?

Option Explicit is used to force explicit declaration of all variables inside your script. This statement is always used at the top of all VBScript statements. This means, you are forced to declare all your variables using either of the statements “Dim”,“Public” or “Private”.

Now lets see what happens if we try to use a variable without using Dim statement in the case when Option Explicit statement is also used.

Option Explicit
A=10
MsgBox A

This is the output you will get:


Hence to avoid this error, use the following code:

Option Explicit
Dim A
A=10
MsgBox A


Please wait for my next VBScript Tutorial in this series going to be posted very shortly.

Keywords:
QTP, QTP & VBScript, VBScript Tutorial, VBScript & QTP

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 31 Dec 2008 19:53
Let us try to understand this concept of fault tolerance a bit Step-by-step.

What is a Fault Tolerant System?
When any system is able to recover from some unexpected errors and is able to restore the normal operation, it is known as a Fault Tolerant system.

When do we need a fully Fault Tolerant System?
Since it is a very complex & costly process to ensure perfect error recovery in a fault tolerant systems, this approach is deployed in applications where safety, availability and time requirements are of prime importance.

Why there is a need to tackle the Errors?
Only the single major characteristic i.e. Reliability identifies any high-quality software. A good piece of software must be able to behave as expected in almost all situations. Although software development companies, during the process of development, try their best to avoid, detect and remove maximum umber of errors as possible, still they can’t take it for granted that the delivered software is free of errors. Due to this there comes the need to have adequate mechanism in place, which could protect the productive system from unacceptable behavior in case of error like situations.

How to handle the situation in case of an error?
When an error occurs primarily due to some faulty design and we are not able to rectify the fault on-line, and we can not afford to move ahead with inconsistent or corrupted data. In such situation it is best to terminate the application in a controlled way (of course whenever possible) rather than trying to do recovery from the error to continue the normal operation.

Usually a script designed for testing an application remains in a Technically Feasible / Good State, during the normal operation. However Good States always have their evil counterparts as well i.e. the Bad States. And the creator of the scripts would never like his script to land into such Bad States. But a patient tester keeps him mentally prepared for his script landing into a Bad State & he tries to minimize such problematic by anticipating such problem situations and ably converts them into expected situations for his benefit.

What should be the realistic approach?
The best approach in business information systems is generally aimed at pumping maximum resources of time, money & efforts in prevention of errors during the development and creation of robust system. This would ensure correctness and integrity of the data and will go even one-step further in prevent any corruption and loss of the data.

Understanding Error-handling Mechanism of a Test Tool:
Almost each & every test tool addresses following elements of its error handling mechanism:

1) Fault: It is the origin of any misbehavior. It is the byproduct or the cause of an error.

2) Error: It is a part of a system state, which leads to a failure. User errors don’t become a part of this definition, since user errors are mistakes committed by the user while operating a software system.

3) Detector: An error needs to be detected first before the tool can act on it. The error handling mechanisms in a tool interacts with errors and failures of the application. Thus a detector is an interface between the error and failures taking place in the system.

4) Failure: It is a deviation of the delivered application in its compliance with the basic specifications. It differs from error in way that the error refers to a particular state of a system, whereas a failure is a specific event, which is basically a transition from the correct delivery to the incorrect delivery.

5) Exception: It is an abnormal condition, which interrupts the normal control flow. To raise an exception, a program needs to detect an error or failure first.

A typical relationship among above-mentioned elements of error handling mechanism are explained pictorially as under.


QTP & its error handling potentials:
QTP along with its prime companion VBScript (if designed with care & consideration) are quite powerful in handling errors and Exceptions. Design & developments of QTP scripts is an art, but not too difficult to learn & master.


As said earlier, design of good script for QTP is extremely important, so that the script behaves well in almost every situation and it should be able to handle not only with the normal situations but also many unexpected situations.

While designing scripts for QTP, the script designer must keep the underlying motto at the back of his mind and that is "Expect the Unexpected". Development of QTP scripts is thus treated almost similar to the development of any other software package & I feel that both of these need to be treated the same way.

Attributes of a strong error handling system:Robust scripts capable of tackling problematic states are designed to operate under architecture, equipped with error handling facilities like:

1) Ability to detect errors.
2) Ability to handle errors.
3) Transmission of error related information among all concerned
4) Management of important information for analyzing & resolving the errors.
5) Management of error messages for reporting to the user or the testers.

Error handling mechanisms of QTP:
During the run session, if an error occurs in QTP the script is halted & the error handling mechanism of QTP releases a popup message box describing the error to the user informing of the problem. The user is prompted to select an option of clicking a button on this message box to either continue to execute the program or end the run session. The error message can accompany a screenshot / bitmap capture of the error event for better clarity.

The tester has option to accept the Popup Message Box option or he can specify a different response by choosing one of the alternative options in the list in the "When error occurs during run session" box:

a) Proceed to next action iteration – QTP proceeds to the next action iteration when an error occurs.

b) Stop run – QTP stops the run session when an error occurs.

c) Proceed to next step - QTP proceeds to the next step in the test when an error occurs.

QTP first performs the particular recovery scenarios associated with the test, and performs the option selected above only if the associated recovery scenarios are not able to resolve the error.


Programmatically Controlling the Recovery Mechanism in QTP:
Recovery object can be used to control the recovery mechanism programmatically during the run session. For example, the entire recovery mechanism or particular recovery scenarios can be enabled or disabled. The status information related to the particular recovery scenarios can be retrieved and the recovery mechanism at a certain point in the run session can be activated.


By default, QTP checks for recovery triggers when an error is returned during the run session. We can use the Recovery object's Activate method to force QTP to check for triggers after a specific step in the run session. For example, when we are aware of the fact that an object property checkpoint will fail if certain processes are open when the checkpoint is performed. We want to be sure that these open processes, which may indicate a different problem with the application, do not affect the pass or fail of the checkpoint.

However, a failed checkpoint does not result in a run error. Hence by default, the recovery mechanism would not be activated by the Object State. We can define a recovery scenario, which looks for, and closes specified open processes when an object's properties have a certain state. This state shows the object's property values, as they would be if the problematic processes were open. We can instruct QTP to activate the recovery mechanism if the checkpoint fails so that QTP will check for and close any problematic open processes and then try to perform the checkpoint again. This ensures that when the checkpoint is performed the second time the open processes do not affect it.

Use of Check Points in QTP:
As said earlier that prevention is better than cure, QTP provides a very powerful tool of using Checkpoints to check various objects in the application to ensure that they function properly.

Checkpoint is nothing but a point of verification, which compares a current value for a specified property with the expected value for that property. This enables the tester to identify whether the application is functioning correctly or not. When the test is run, QTP compares the expected results of the checkpoint with the current results. If the results do not match, the checkpoint fails & the end result gets displayed in the result window.

QTP provides eleven types of checkpoints to the testers. The details of each & every Checkpoint are not included in this article.

Use of Synchronization Points in QTP:
As an alternative to create a checkpoint or perform a step until the application object aquires a particular status, a synchronization point can be inserted to instruct QTP to halt the testing process till the object property reaches a value specified by us (or till a timeout specified by us has exceeded).

If we don’t have a synchronization point, QTP is likely to click the Update Order button too quickly during the test execution process, which will result in failure of the test.

Finally - Understanding of the Best Practices:

1) A best method to use error-handling mechanism is to try to prevent the errors. Whenever an error happens, try to capture the maximum related information & report it in detail.

2) Perform a syntax check every time the script is changed.


Key Words : QTP, Error Handling, Recovery Scenario, Synchronization, Check Point, Recovery Mechanism
Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 31 Dec 2008 18:48
Here I am presenting a workaround to manipulate or overriding the Naming Conventions generally assigned by QTP to the test objects.

Did you ever notice that QTP gives a random name to the objects after recording which even seems vague at times.

Let me show you an example to demonstrate my point. I tried recording on the Google home page and got this code from QTP after recording after writing some text in the Google search box:

Browser("Google").Page("Google").WebEdit("q").Set "This is the sample text"

As you can see from the above code, the name which has been assigned to the WebEdit box is "q". How many of you agree that this "q" seems a valid name? Though this "q" is the name of the search box which has been hard coded by the Google developers. I have extracted the following code from the Google’s webpage to illustrate my point:

input maxlength=2048 name=q size=55 title="Google Search" value=""

I believe that QTP doesn’t name the test objects properly. There is certainly a way by which we can instruct QTP to name the text objects as per our chosen properties.

The following are the steps for the same:

1. Close your HP QTP software.

2. Navigate to Start->Run.

3. Type "regedit" and press enter to open the Registry Editor.

4. Inside your "Registry Editor" navigate to HKEY_CURRENT_USER -> Software -> Mercury Interactive -> QuickTest Professional -> MicTest -> Test Objects.

Here, you can see so many keys like WebEdit, WebElement etc etc. Yes, you guessed right. These are in fact all the built-in keys classes of QTP. Expand any key of your choice for editing.

In this tutorial, I will select WebEdit class which is very frequently used in QTP. You will see a key named "tag query name" as highlighted in the following screenshot which has the value "logical name". You will see the same value for "tag query name" key for all the inbuilt classes.



Now double click the "tag query name" key. You will see the following screenshot. Provide any name of your choice. I provided "QTP Expert" and press enter.




Close the Registry Editor and open your HP Quicktest Professional (QTP) software. Open google.com webpage again and record again. [ Make sure you open the google webpage only after opening QTP]. You will see a code something like this:

Browser("Google").Page("Google").WebEdit("WebEdit").Set "This is the sample text "

I hope, you must have noticed the difference after tweaking the registry editor.

This technique doesn’t seem to be used too often, however it is possible to override the standard naming convention of objects through QTP by doing some minor changes in Registry Editor.

KeyWords: QTP, Quicktest, Object Naming
Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 31 Dec 2008 17:17
I believe you have used "msgbox" function almost every time for debugging purposes i.e. displaying some text at run time. But the problem with "msgbox" function is that it keeps open till you close it and moreover you can’t debug further, since it’s a modal dialog box. You have to press OK button to move ahead.

How about a similar utility function, which works very similar, like "msgbox" and also provides the user the flexibility to perform further debugging?


Yes, it is possible. HP Quicktest Professional (QTP) provides a Print utility statement which is used to display information in the "QuickTest Print Log" window while still continuing your Run Session.


Looks pretty interesting!!!!!!! Alright, then go ahead and read more.

Firstly let us see what happens in case of "msgbox" function. As soon as the script encounters the "msgbox" function, it displays a dialog box and the script gets paused till the user presses the OK button.


Following screenshot demonstrate the concept.
Here you need to press the OK button in order to continue.

In order to counter this problem, HP QTP also provides a fantastic Print utility which is very similar to its "msgbox" counterpart but much more flexible. It can be used for debugging purposes. It is very simple to use inside QTP tool.

Following screenshot demonstrate the concept.


As you can see from this screenshot, QuickTest Print Log window remains open even after your script has finished running, thus providing more flexibility.

So from now on which one you would like to use? QTP’s "msgbox" function or QTP’s Print Utility Statement?

Did you like my explanation of the concept in the above article?

Being Technology Savvy, I am sure you must be curious to read many more interesting articles on QTP; How about subscribing to my Feed? This will help you in automatically knowing the moment I post an article on my Site.

So let us join and let us Learn & Master the great Tool QTP.

Keywords: HP QTP, Quicktest Professional, QTP Blog, QTP msgbox function, QTP Print utility statement


Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 19 Nov 2008 10:02
Q. 71: What are the various types of objects identified by the comparison tool in QTP?
================================================

1) Identical: Objects that appear in both object repository files. There is no difference in their name or in their properties.

2) Matching description, different name: Objects that appear in both object repository files that have different names, but the same description properties and values.

3) Similar description: Objects that appear in both object repository files that have similar, but not identical, description properties and values. One of the objects always has a subset of the properties set of the other object. This implies that it is likely to be a less detailed description of the same object. For example, an object named Button_1 in the second object repository has the same description properties and values as an object named Button_1 in the first object repository, but also has additional properties and values.

Objects that do not have a description, such as Page or Browser objects, are compared by name only. If the same object is contained in both the object repositories but with different names, they will be shown in the object repositories as two separate objects.

4) Unique to first file, or Unique to second file. Objects that appear in only one of the object repository files.

=================================================
Q. 72: What are the situations best suited to Recording in QTP?
=================================================
Recording can be useful in the following situations:

# Recording helps novice QuickTest users learn how QTP interprets the operations you perform on your application, and how it converts them to QTP objects and built-in operations.

# Recording can be useful for more advanced QTP users when working with a new application or major new features of an existing application (for the same reasons described above). Recording is also helpful while developing functions that incorporate built-in QTP keywords.

# Recording can be useful when you need to quickly create a test that tests the basic functionality of an application or feature, but does not require long-term maintenance.

===================================================
Q. 73: What are the advantages of Keyword Driven testing in QTP?
===================================================

1) Keyword-driven testing enables you to design your tests at a business level rather than at the object level.

2) By incorporating technical operations, such as a synchronization statement that waits for client-server communications to finish, into higher level keywords, tests are easier to read and easier for less technical application testers to maintain when the application changes.

3) Keyword-driven testing naturally leads to a more efficient separation between resource maintenance and test maintenance. This enables the automation experts to focus on maintaining objects and functions while application testers focus on maintaining the test structure and design.

4) When you record tests, you may not notice that new objects are being added to the local object repository. This may result in many testers maintaining local object repositories with copies of the same objects. When using a keyword-driven methodology, you select the objects for your steps from the existing object repository. When you need a new object, you can add it to your local object repository temporarily, but you are also aware that you need to add it to the shared object repository for future use.

=========================================
Q. 74: What are Absolute and Relative Paths in QTP?
=========================================

You can save QuickTest resources, such as shared object repositories, function libraries, recovery scenarios or environments, using absolute or relative paths.

1) An absolute path: Describes the full path to a specific file starting from a fixed location such as the root directory, or the drive on which the file is located, and contains all the other sub-directories in the path. An absolute path always points to the specified file, regardless of the current directory.

2) A relative path: Describes the path to a specific file starting from a given directory, and is generally only a portion of the absolute path. A relative path therefore specifies the location of the file relative to the given location in the file system.

Using relative paths means that the paths remain valid when files or folders containing files are moved or copied to other locations or computers, provided that they are moved within the same folder structure. For this reason, we recommend that you use relative paths when saving resources in QTP.

===============================================
Q. 75: What are the situations best suited to keyword-driven methodology in QTP?
===============================================
The keyword-driven methodology is especially useful for organizations that have both technical and less technical users because it offers a clear division of automation tasks. This enables a few experts to maintain the resource framework while less technical users design and maintain automated test steps. Additionally, once the basic infrastructure is in place, both types of users can often do their tasks simultaneously.

===============================================
Q. 76: What are the various categories of output values in QTP?===============================================
we can create following categories of output values:

1) Standard output values
2) Text and text area output values
3) Table output values
4) Database output values
5) XML output values

=================================================
Q. 77: How do you analyze your application to determine your testing needs using QTP?.
=================================================

1) Determine the development environments that QuickTest needs to support:Your application comprises of windows containing a hierarchy of objects that were created in one or more development environments. QTP provides support for these environments using add-ins. You load QTP add-ins when QTP opens by using the Add-in Manager dialog box. You can check which add-ins are loaded by choosing Help > About QuickTest Professional.

2) Prepare the information that QTP needs to identify objects in your application and to open your application at the beginning of a run session. You need to know the URL, the executable file name and path, or other command-line information. Later, you will enter this in Record and Run Settings dialog box.

3) Navigate through your application from a customer’s perspective and perform the tasks that customers might perform. You create an action for each sub-process, or task, a customer might perform. Each process you perform in your application will be represented as a test in QTP. You can create your tests now.

===================================================
Q. 78: In what situations recording mechanism shall be useful in creating the tests in QTP?

===================================================
1) You are new to QTP and want to learn how QTP interprets the operations you perform on your application and how it converts them to QTP objects and built-in operations.

2) You need to quickly create a test that tests the basic functionality of an application or feature, and the test does not require long-term maintenance.

3) You are working with a new application or with major new features of an existing application, and you want to learn how QTP interacts with the application.

4) You are developing functions that incorporate built-in QTP keywords.

==========================================
Q. 79: What are the various recording modes in QTP?==========================================

1) Normal or the default recording mode: This records the objects in your application and the operations performed on them. This mode takes full advantage of the QTP object model, recognizing the objects in your application regardless of their location on the screen.

2) Analog Recording: This 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, QTP records and tracks every movement of the mouse as you drag the mouse around a screen or window.

3) Low Level Recording:This enables you to record on any object in your application, whether or not QTP recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or WinObject test objects.

===================================================
Q. 80: How can we switch to Low Level Recording mode while editing a test?===================================================

You can switch to Low Level Recording mode only while recording a test. The option is not available while editing a test.

Keyword: QTP Interview Questions, FAQ QTP
Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 29 Oct 2008 19:14
These days I am getting several emails from the esteemed readers of my blog, who are curious to know the answer to a most sought after question; which goes like:

"Hi Expert !!!! Can you please suggest me how can I register for HP Quicktest Professional (QTP) Certification, what's the exam fee, What's the structure of Certification Exam etc etc."

Hence for the benefit of my curious readers, I am publishing this post which will answer all such queries:

1. The code for the HP QTP certification exam is HPO: M16

2. You need to open this website for more details: http://www.register.prometric.com/Index.asp

3. Here in this website, Select your Country for example United States. Then select a state for example Alaska. Click on the Next button.

4. Select Hewlett Packard from Client as shown in the following screenshot. Click on the Next button.


5. Again click on the Next button on HP Certified Professional Page. You will see the following page.

6. Select HPO-M16 from Exam as shown in the following screenshot. The exam fees may vary according to the location of your country.

7. In the next page, you will see a list of Center locations along with their Contact Numbers which conducts this exam. You guys can contact any of these Centers based on your choice.

8. Once ready for the exam after paying the fee, be prepared to answer a set of 60 Nos. Multiple choice questions, having a Minimum Passing Score of 70%.


9. Time commitment for the QTP Certification exam is 2 Hours.

10. You will get a Scorecard after clearing the QTP certification exam and for getting a Certificate you need to clear the QC exam / HP Quality Center Exam as well.


If you need specialized help in learning QTP leading to HP Certification, Please let me know.

All the Best Friends !!!!!!!!!!!!

Posted By : QTP Expert
expert.qtp@gmail.com

Keywords: HP QuickTest Professional Certification, QTP Certification, HP Certified Professional Exam, Registration for QTP Certification, QTP Training

Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 15 Oct 2008 15:10

Q. 101: What is the process of capturing visible portion of an object in QTP?
=====================================================

QTP captures the visible part of the specified object as a bitmap and inserts a checkpoint in the test. QTP does not capture any part of the screen which happens to be scrolled off the screen. You can check an area of an application as a bitmap. While creating a test, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object.

==================================================
Q. 102: What is the process of comparing selected area of object with Bitmap stored in the checkpoint?
==================================================

When you run the test, QTP compares the object or selected area of the object in the application with the bitmap stored in the checkpoint.

If there are differences, QTP captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy.

=================================================
Q. 103: How can we define a time interval for QTP to perform a checkpoint successfully?
=================================================


For defining some time interval (say in seconds) during which QTP shopuld attempt to perform the checkpoint successfully, we need to specify the Checkpoint Timeout. QTP continues to perform the checkpoint until it passes or until the timeout occurs. If the checkpoint does not pass before the timeout occurs, the checkpoint fails.

For example, suppose it takes some time for an object to achieve an expected state. Increasing the checkpoint timeout value in this case can help ensure that the object has sufficient time to achieve that state, enabling the checkpoint to pass (if the data matches) before the maximum timeout is reached.

==============================================
Q. 104: How can we check the object property values in our application?
==============================================


You can check that a specified object in your application has the property values you expect, by adding a standard checkpoint step to your test while recording or editing the test. Standard checkpoints compare the expected values of object properties to the object’s current values during a run session.

We can use standard checkpoints to perform checks on images, tables, Web page properties, and other objects within our application.

=======================================
Q. 105: How can we identify a checkpoint in QTP?=======================================
We identify a checkpoint by its name. By default, the checkpoint name is the same as the name of the test object on which the checkpoint was created. You can specify a different name for the checkpoint or accept the default name.

If you want to rename a checkpoint, make sure that the name is unique, and it does not begin or end with a space, and does not contain the special charactesr like " := @@

===============================================
Q. 106: How can we Insert statement option when adding a checkpoint during the recording?
===============================================


The Insert statement option is not available when adding a checkpoint during recording or when modifying an existing object checkpoint. It is available only when adding a new checkpoint to an existing test while editing it.

=============================================
Q. 107: How can we compare the image files in the Image Checkpoint?
=============================================


We can compare the image files in the Image Checkpoint by using the Compare image content option in the Image Checkpoint Properties dialog box. It compares the expected image source file with the graphic of the actual image source file. If the expected and actual images are different, QTP displays them both in the Test Results. If the images are identical, only one graphic is displayed.

====================================================
Q. 108: How can we check the contents of tables in our application in QTP?
====================================================

We can check the contents of tables in our application by adding table checkpoints to the test. For example, you can check that a specified value is displayed in a particular cell. We can also check the properties of the table object. For example, you can check that a table has the expected number of rows and columns.

When you run the test, the table checkpoint compares the actual data to the expected data, as defined in the checkpoint. If the results match, the checkpoint passes.

====================================================
Q. 109: How do we compare actual cell values with the expected cell values in Tables in QTP?.
====================================================

By using the Settings tab we can compare actual cell values with the expected cell values in tables. Bu using Verification type option we can compare following types of cell contents.

1) String Content: It is the default setting. It treats the cell values as strings and checks for the exact text, while ignoring spaces. For example, 2 and 2.00 are not recognized as the same string.

2) Numeric Content: Evaluates the content of the cell according to numeric values. For example, 2 and 2.00 are recognized as the same number.

3) Numeric Range: Compares the content of the cell against a numeric range, where the minimum and maximum values are any real number that you specify.

=====================================================
Q. 110: How can we check the location of a cell to be checked in a Column of a table?
=====================================================

By the use of Identify columns option available in Cell Identification tab. This specifies the location of the column containing the cells with which you want to compare the expected data. This is done in two ways:

1) By position: This is the Default option. It locates cells according to the column position. A shift in the position of the columns within the table results in a mismatch.

2) By column name: It locates cells according to the column name. A shift in the position of the columns within the table does not result in a mismatch. This option gets enabled only when the table contains more than one column.

Keyword: QTP Interview Questions, FAQ QTP

Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 15 Oct 2008 14:53
Q. 91: What is a Standard Check Point in QTP?=====================================
It is a checkpoint which checks the property value of an object in your application. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, and so forth. For example, you can check that a radio button is activated after it is selected or you can check the value of an edit box.

Standard checkpoints are supported for all add-in environments.

===================================
Q. 92: What is a Image Check Point in QTP?===================================

It is a checkpoint ahich checks the value of an image in your application. For example, you can check that a selected image’s source file is correct. Image checkpoint is created by inserting a standard checkpoint on an image object.

Image checkpoints are supported for the Web add-in environment.

====================================
Q. 93: What is a Bitmap Check Point in QTP?====================================

It is a checkpoint which checks an area of your application as a bitmap. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create a bitmap checkpoint for any area in your application, including buttons, text boxes, and tables.

Bitmap checkpoints are supported for all add-in environments

==================================
Q. 94: What is a Table Check Point in QTP?
==================================

It is a checkpoint which checks information within a table. For example, suppose your application contains a table listing all available flights from New Delhi to Chennai. You can add a table checkpoint to check that the time of the first flight in the table is correct.
You create a table checkpoint by inserting a standard checkpoint on a table object.
Table checkpoints are supported for Web, ActiveX, Java, Oracle, and .NET Windows Forms environments, as well as other add-in environments

==================================
Q. 95: What is a Text Check Point in QTP?
==================================

It is a checkpoint which checks that a text string is displayed in the appropriate place on a Web page or application. For example, suppose a Web page displays the sentence Flight departing from New Delhi to Chennai. You can create a text checkpoint that checks that the words “New Delhi” are displayed between “Flight departing from” and “to Chennai”.

Text checkpoints are supported for most add-in environments

=====================================
Q. 96: What is a Text Area Check Point in QTP?=====================================

It is a checkpoint which checks that a text string is displayed within a defined area in a Windows-based application, according to specified criteria. For example, suppose your Visual Basic application has a button that says View Doc , where is replaced by the four digit code entered in a form elsewhere in the application. You can create a text area checkpoint to confirm that the number displayed on the button is the same as the number entered in the form.

Text area checkpoints are supported for all Windows-based environments, such as Standard Windows, Visual Basic, and ActiveX add-in environments

========================================
Q. 97: What is an Accessibility Check Point in QTP?========================================

It is a checkpoint which identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines. For example, guideline 1.1 of the W3C WebContent Accessibility Guidelines requires you to provide a text equivalent for every non-text element. You can add an Alt property check to check whether objects that require the Alt property under this guideline, do in fact have this tag.

Accessibility checkpoints are supported for the Web add-in environment.

===================================
Q. 98: What is a Page Check Point in QTP?
===================================
It is a checkpoint checks the characteristics of a Web page. For example, you can check how long a Web page takes to load or whether a Web page contains broken links.

You create a page checkpoint by inserting a standard checkpoint on a page object. Page checkpoints are supported for the Web add-in environment.

=====================================
Q. 99: What is a Database Check Point in QTP?=====================================

It is a checkpoint which checks the contents of a database accessed by your application. For example, you can use a database checkpoint to check the contents of a database containing flight information for your Web site.

Database checkpoints are supported for all add-in environments

===================================
Q. 100: What is a XML Check Point in QTP?===================================

It is a checkpoint which checks the data content of XML documents in XML files or XML documents in Web pages and frames. The XML Checkpoint option is supported for the Web add-in environment & for all add-inenvironments.

Keyword: QTP Interview Questions, FAQ QTP
Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 08 Oct 2008 14:02

Q. 81: What is the use of Keyword View in QTP?=====================================

The Keyword View enables you to create and view the steps of your test in a modular, table format. Each step is a row in the Keyword View that is comprised of individual, modifiable parts. You create and modify steps by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as youcomplete it, enabling you to view a description of your test in understandable sentences.

===================================================
Q. 82: What are the Conditional and Loop Statements used in the Keyword View in QTP?
===================================================

Using conditional statements, you can incorporate decision making into the tests. Using loop statements, you can run a group of steps repeatedly, either while or until a condition is true. You can also use loop statements to repeat a group of steps a specific number of times. A few conditional & Loop statements are given below:
1) If...Then statement
2) ElseIf...Then statement
3) Else statement
4) While...Wend statement
5) For...Next statement
6) Do...While statement
7) Do...Until statement

=================================================
Q. 83: What is the use of a Comment in the Comment cell of a step in QTP?
=================================================

A Comment is free text entry which can help improve readability and make a test easier to update. For example,you may want to add a comment step at the beginning of each action to specify what that section includes.

QTP does not process comments when it runs a test.

============================================
Q. 84: What are Nesting Actions & what is the use of them?============================================

Sometimes you may want to call an action from within an action. This is called nesting. By nesting actions, you can:

1) Maintain the modularity of your test.
2) Run one or more actions based on the results of a conditional statement.

=============================================
Q. 85: Splitting Actions option is not available under what circumstances in QTP?=============================================

You cannot split an action, and the option is disabled when:
1) An external action is selected
2) The first step of an action is selected
3) You are working with a read-only test
4) Recording a test
5) Running a test

=========================================
Q. 86: What is the use of Action Parameters in QTP?=========================================

Action parameters enable you to transfer input values from your test to a top-level action, from a parent action to a nested action, or from an action to a sibling action that occurs later in the test.

You can use action parameters in any step in your action including function calls.


===================================================
Q. 87: What are the various types of Exit Action Statements in QTP?===================================================

There are four types of exit action statements you can use:
1) ExitAction: Exits the current action, regardless of its iteration attributes.
2) ExitActionIteration: Exits the current iteration of the action.
3) ExitRun: Exits the test, regardless of its iteration attributes.
4) ExitGlobalIteration: Exits the current global iteration.

=====================================
Q. 88: What is the use of check points in QTP?=====================================

A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether your application is functioning correctly.

When you run the test, QTP compares the expected results of the checkpoint to the current results. If the results do not match, the checkpoint fails. You can view the results of the checkpoint in the Test Results window.

==================================================
Q. 89: What are the situations best suited for using an existing Check Point?==================================================

1) If each page of your application contains your organization’s logo, you can reuse a bitmap checkpoint to verify each occurrence in the application.

2) If your application contains multiple edit boxes, you can reuse a checkpoint to confirm the enabled status of these edit boxes throughout your test.

===================================================
Q. 90: What is the reason that "Add Existing Checkpoint" dialog box is not visible?===================================================

"Add Existing Checkpoint" dialog box option is available only if at least one of the object repositories associated with the current action (including the local object repository) contains at least one checkpoint.

Keyword: QTP Interview Questions, FAQ QTP

Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 08 Oct 2008 01:30
We use &_ to separate multiple lines inside our script whom we want to execute as a single command by clubbing together. Lets see the below mentioned example to make the point more clearer.


As you must have observed above, the character “&” is used to concatenate the strings while the character “_” is used to concatenate multiple lines. So on combining these two characters ie “&_” we are instructing QTP to concatenate strings spanning across multiple lines.

We could have wrote the “f.Write…………” in single line but it would have been very hard to read.

A more simple example to illustrate the usage can be:

Browser(“QTP”).Page(“QTP”). WebEdit("TextField").Set “Expert”&_
"loves QTP" &_
"Any Doubts?"

Keywords: QTP
Author: "QTP Expert (noreply@blogger.com)"
Send by mail Print  Save  Delicious 
Date: Wednesday, 01 Oct 2008 10:41
Q. 61: How can we perform Merge Operations among various object repositories?======================================================
The Object Repository Merge Tool enables you to merge test objects from the local object repository of one or more actions to a shared object repository using the Update from Local Repository option in the Object Repository Manager.

For example, you may have learned test objects locally in a specific action in your test and want to add them to the shared object repository so they are available to all actions in different tests that use that object repository. You can also use the Object Repository Merge Tool to merge two shared object repositories into a single shared object repository.

You open the Object Repository Merge Tool by choosing Tools > Object Repository Merge Tool in the Object Repository Manager.

==================================================
Q. 62: How can we perform Import & Export Operations among various object repositories?
==================================================

You can import and export object repositories from and to XML files. XML provides a structured, accessible format that enables you to make changes to object repositories using the XML editor of your choice and then import them back into QTP.

You can import and export files either from and to the file system or a Quality Center project.

You can import an XML file as an object repository. The XML file can either be an object repository that you exported to XML format using the Object Repository Manager, or an XML file created using a tool such as QTP Siebel Test Express or a custom built utility. You must adhere to the XML structure and format.

===============================================
Q. 63: How can we Integrate QuickTest with Quality Center?===============================================

You integrate QTP with Quality Center using the Quality Center Connectivity Add-in. This add-in is installed on your QTP computer automatically when you connect QTP to Quality Center using the Quality Center Connection dialog box. You can also install it manually from the Quality Center Add-ins page (available from the Quality Center main screen) by choosing Quality Center Connectivity.

integrating QTP with Quality Center enables you to store and access QTP tests and function libraries in a Quality Center project, when QTP is connected to Quality Center.

=======================================
Q. 64: What is the use of Template Tests in QTP?=======================================
Template tests serve as the basis for all QTP tests created in Quality Center. A template test is a QTP test that contains default test settings. For example, a template test might specify the QTP add-ins, associated function libraries, and recovery scenarios that are associated with a test. You can modify these test settings in the Test Settings dialog box (File > Settings) in QuickTest.

In addition to default test settings, a template test can also contain any comments or steps you want to include with all new QTP tests created in Quality Center. For example, you may want to add a comment notifying users which add-ins are associated with the template test, or you may want to add a step that opens a specific Web page or application at the beginning of every test. Any steps or comments you add to a template test are included in all new tests created in Quality Center that are based on that template test.

============================================
Q. 65: How can we create a QTP Test in Quality Center?============================================

In Quality Center, you create QuickTest tests in the Test Plan module. When you create a QuickTest test, you apply a template test to it. You can choose either the default template test stored on your QuickTest client, or a template test that is saved in your Quality Center project.
If you do not have any template tests saved in your Quality Center project, or if you choose in the Template box, Quality Center uses the settings defined in the template test that was installed with the QTP Add-in for Quality Center on your Quality Center client.

======================================
Q. 66: What is Business Process Testing model?======================================

The Business Process Testing model is role-based, allowing non-technical Experts working in Quality Center to collaborate effectively with Automation Engineers working in QTP.

Non-technical Subject Matter Experts define and document business processes, business components, and business process tests, while Automation Engineers define the required resources and settings, such as shared object repositories, function libraries, and recovery scenarios. Together, they can build, data-drive, document, and run business process tests, without requiring programming knowledge on the part of the Non-technical Subject Matter Expert.

==================================================
Q. 67: What is the role of Subject Matter Expert in the Business Process Testing model?
==================================================

The Subject Matter Expert has specific knowledge of the application logic, a high-level understanding of the entire system, and a detailed understanding of the individual elements and tasks that are fundamental to the application being tested.

This enables the Subject Matter Expert to determine the operating scenarios or business processes that must be tested and identify the key business activities that are common to multiple business processes.

During the design phase, the Subject Matter Expert works with the Automation Engineer to identify the resources and settings needed to automate the components, enabling the Automation Engineer to prepare them.

The Subject Matter Expert configures the values used for business process tests, runs them in test sets, and reviews the results. The Subject Matter Expert is also responsible for maintaining the testing steps for each of the individual business components.

While defining components, Subject Matter Experts continue collaborating with the Automation Engineer.

==================================================
Q. 68: What is the role of Automation Engineer in the Business Process Testing model?
==================================================

The Automation Engineer is an expert in using an automated testing tool, such as QTP. The Automation Engineer works with the Subject Matter Expert to identify the resources that are needed for the various business process tests.

The Automation Engineer then prepares the resources and settings required for testing the features associated with each specific component, and stores them in an application area within the same Quality Center project used by the Subject Matter Experts who create and run the business process tests for the specific application.

The Automation Engineer uses QTP features and functionality to create these resources from within QTP.

===================================================
Q. 69: What are the Differences Between Components and Tests?===================================================
# A component is a single entity. It cannot contain multiple actions or have calls to other actions or to other components.

# When working with components, all external files are stored in the Quality Center project to which you are currently connected.

# The name of the component node in the Keyword View is the same as the saved component. You cannot rename the node.

# Business components are created in the Keyword View, not the Expert View.

# You add resources via the component’s application area, and not directly to the component.

# Components use custom keywords created in function libraries to perform operations, such as verifying property values and opening the application you are testing.

======================================================
Q. 70: How can we compare objects among two object repositories?======================================================

In QTP, we can compare existing assets from two object repositories using the Object Repository Comparison Tool.

The tool is accessible from the Object Repository Manager, and enables you to compare different object repository resources, or different versions of the same object repository resource, and identify similarities, variations, or changes.

Differences between objects in the two object repository files, named the First and Second files, are identified according to default rules. During the comparison process, the object repository files remain unchanged.

After the compare process, the Comparison Tool provides a graphic presentation of the objects in the object repositories, which are shown as nodes in a hierarchy.

Keyword: QTP Interview Questions, FAQ QTP
Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 01 Oct 2008 10:39

Q. 51: What is the use of mapping Repository Parameter Values in QTP
====================================================

You can map repository parameters that are used in shared object repositories that are associated with your action. Mapping a repository parameter to a value or parameter specifies the property values used toidentify the test object during a run session. You can specify that the property value is taken from a constant value, or parameterize it using a Data Table, random number, environment, or test parameter.

You can map each repository parameter as required in each test that has an associated object repository containing repository parameters.

If you do not map a repository parameter, the default value that was defined with the parameter, if any, is used during the action run. If the parameter is unmapped, meaning no default value was specified for it, the test run may fail if a test object cannot be identified because it has an unmapped parameter value.

===========================================
Q. 52: What are the various Object Properties in QTP?===========================================
QTP has a predefined set of properties that it learns for each test object. If these mandatory property values are not sufficient to uniquely identify a learned object, QTP can add some assistive properties and/or an ordinal identifier to create a unique description.

Mandatory properties are properties that QTP always learns for a particular test object class.

Assistive properties are properties that QTP learns only if the mandatory properties that QTP learns for a particular object in your application are not sufficient to create a unique description. If several assistive properties are defined for an object class, then QTP learns one assistive property at a time, and stops as soon as it creates a unique description for the object. If QTP does learn assistive properties, those properties are added to the test object description.

=====================================================
Q. 53: What are the various types of ordinal identifiers used by QTP to identify an object?
=====================================================

1) Index Property: Indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.

2) Location Property: Indicates the order in which the object appears within the parent window, frame, or dialog box relative to other objects with an otherwise identical description.

3) CreationTime Property: (For Browser object only.) Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description.

===================================================
Q. 54: What is Index Property for identifying the objects in QTP?===================================================

While learning an object, QTP can assign a value to the test object’s Index property to uniquely identify the object. The value is based on the order in which the object appears within the source code. The first occurrence is 0.

Index property values are object-specific. Therefore, if you use Index:=3 to describe a WebEdit test object, QTP searches for the fourth WebEdit object in the page.

However, if you use Index:=3 to describe a WebElement object, QTPt searches for the fourth Web object on the page—regardless of the type—because the WebElement object applies to all Web objects.

=====================================================
Q. 55: What is Location Property for identifying the objects in QTP?=====================================================

While learning an object, QTP can assign a value to the test object’s Location property to uniquely identify the object. The value is based on the order in which the object appears within the window, frame, or dialog box, in relation to other objects with identical properties. The first occurrence of the object is 0. Values are assigned in columns from top to bottom, and left to right.

Location property values are object-specific. Therefore, if you use Location:=3 to describe a WinButton test object, QTP searches from top to bottom, and left to right for the fourth WinButton object in the page. However, if you use Location:=3 to describe a WinObject object, QuickTest searches from top to bottom, and left to right for the fourth standard object on the page— regardless of the type—because the WinObject object applies to all standard objects.

=====================================================
Q. 56: What is Creation Time Property for identifying the objects in QTP?
=====================================================

While learning a browser object, if QTP is unable to uniquely identify the object according to its test object description, it assigns a value to the CreationTime test object property. This value indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description. The first browser that opens receives the value CreationTime = 0.

During the run session, if QTP is unable to identify a browser object based solely on its test object description, it examines the order in which the browsers were opened, and then uses the CreationTime property to identify the correct one.

For example, if you record a test on three otherwise identical browsers that are opened at 9:01 pm, 9:03 pm, and 9:05 pm, QuickTest assigns the CreationTime values, as follows: CreationTime = 0 to the 9:01 am browser, CreationTime = 1 to the 9:03 am browser, and CreationTime = 2 to the 9:06 am browser.

At 10:30 pm, when you run your test, suppose the browsers are opened at 10:31 pm, 10:33 pm, and 10:34 pm. QTP identifies the browsers, as follows: the 10:31 pm browser is identified with the browser test object with CreationTime = 0, 10:33 pm browser is identified with the test object with CreationTime = 1, 10:34 pm browser is identified with the test object with CreationTime = 2.

===========================================
Q. 57: What is the Smart Identification Process of QTP
===========================================
If QTP activates the Smart Identification mechanism during a run session, it follows the following process to identify the object:

1) QTP “forgets” the learned test object description and creates a new object candidate list containing the objects (within the object’s parent object) that match all of the properties defined in the Base Filter Properties list.

2) QTP filters out any object in the object candidate list that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.

3) QTP evaluates the new object candidate list:
# If the new object candidate list still has more than one object, QTP uses the new (smaller) object candidate list to repeat step 2 for the next optional filter property in the list.

# If the new object candidate list is empty, QTP ignores this optional filter property, returns to the previous object candidate list, and repeats step 2 for the next optional filter property in the list.

# If the object candidate list contains exactly one object, then QTP concludes that it has identified the object and performs the statement containing the object.

4) QTP continues the process described in steps 2 and 3 until it either identifies one object, or runs out of optional filter properties to use. If, after completing the Smart Identification elimination process, QTP still cannot identify the object, then QTP uses the learned description plus the ordinal identifier to identify the object. If the combined learned description and ordinal identifier are not sufficientto identify the object, then QuickTest stops the run session and displays aRun Error message.

======================================================
Q. 58: What happens in case Smart Identification fails to identify the object in QTP?
======================================================
If the Smart Identification mechanism cannot successfully identify the object, QTP uses the learned description plus the ordinal identifier to identify the object.
If the object is still not identified, the test fails and a normal failed step is displayed in the results.

=============================================
Q. 59: What is the use of Repository Parameters in QTP?=============================================
Repository parameters enable you to specify that certain property values should be parameterized, but leave the actual parameterization to be defined in each test that is associated with the object repository that contains the parameterized test object property values.

Repository parameters are useful when you want to create and run tests on an object that changes dynamically. An object may change dynamically if it is frequently updated in the application, or if its property values are set using dynamic content, for example, from a database.

=================================================
Q. 60: How can we locate test objects in an object repository?=================================================

You can search for a specific test object in your object repository in many ways.
You can search for a test object according to its type. For example, you can search for a specific edit box, or you can point to an object in your application to automatically highlight that same object in your repository.

You can replace specific property values with other property values. For example, you can replace a property value userName with the value user name.

You can also select an object in your object repository and highlight it in your application to check which object it is.

After making sure that your shared object repository is the active window, you locate an object in a shared object repository in the same way as you locate it in a local object repository. If you want to replace property values, you must also make sure that the object repository is editable.

Keyword: QTP Interview Questions, FAQ QTP

Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Date: Wednesday, 01 Oct 2008 10:30

Q. 41: What are the various utilities and tools available in QTP?
==================================================
Tools Menu contains the following utilities and tools which are helpful in the testing process:

# Action Conversion Tool: Enables you to convert test actions that were created using QTP to scripted components for use in business process testing.

# Additional Installation Requirements: Opens the Additional Installation Requirements dialog box, which displays any prerequisite software that you must install or configure to work with QTP.

# Business Component Upgrade Tool: Opens the Business Component Upgrade Tool. If you are connected to a Quality Center project, this tool enables you to upgrade all of the business components in a Quality Center project, from an earlier component version to the format required by the current version.

# HP Micro Player: Opens the HP Micro Player, which enables you to view captured movies of a run session without opening QuickTest.

# License Validation Utility: Opens the License Validation utility, which enables you to retrieve and validate license information.

# Password Encoder: Opens the Password Encoder dialog box, which enables you to encode passwords. You can use the resulting strings as method arguments or Data Table parameter values (tests only).

# QTP Script Editor: Opens the QTP Script Editor, which enables you to open and modify the scripts of multiple tests and function libraries, simultaneously.

# Register New Browser Control: Opens the Register Browser Control Utility, which enables you to register your browser control application so that QTP recognizes your Web object when recording or running tests.

# Remote Agent: Activates the QuickTest Remote Agent, which enables you to configure how QuickTest behaves when a test is run by a remote application such as Quality Center.

# Save and Restore Settings: Opens the Save and Restore Settings dialog box, which enables you to save your existing configurations before uninstalling an old version, and then restore them after installing a new version.

# Silent Test Runner: Opens the Silent Test Runner dialog box, which enables you to run a QTP test the way it is run from LoadRunner and Business Availability Center.

# Test Batch Runner: Opens the Test Batch Runner dialog box, which enables you to set up QTP to run several tests in succession.

# Test Results Deletion Tool. Opens the Test Results Deletion Tool dialog box, which enables you to delete unwanted or obsolete results from your system according to specific criteria that you define.

============================================
Q. 42: What is the concept of Test Object Model in QTP?============================================
QTP tests your dynamically changing application by learning and identifying test objects and their expected properties and values. To do this, QTP analyzes each object in your application in much the same way that a person would look at a photograph and remember its details.

The test object model is a large set of object types or classes that QTP uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that QuickTest can learn about it.
A test object is an object that QTP creates in the test to represent the actual object in your application. QTP stores information on the object that will help it identify and check the object during the run session.

A run-time object is the actual object in your application on which methods are performed during the run session.

====================================================
Q.43: Please explain some real world scenario explaining Object Learning process of QTP?
====================================================
QTP learns objects just as you would. For example, suppose as part of an experiment, Alex is told that he will be shown a photograph of a picnic scene for a few seconds during which someone will point out one item in the picture. Alex is told that he will be expected to identify that item again in identical or similar pictures one week from today.

Before he is shown the photograph, Alex begins preparing himself for the test by thinking about which characteristics he wants to learn about the item that the tester indicates. Obviously, he will automatically note whether it is a person, inanimate object, animal, or plant. Then, if it is a person, he will try to commit to memory the gender, skin color, and age. If it is an animal, he will try to remember the type of animal, its color, and so forth.

The tester shows the scene to Alex and points out one of three children sitting on a picnic blanket. Alex notes that it is a Caucasian girl about 8 years old. In looking at the rest of the picture, however, he realizes that one of the other children in the picture could also fit that description. In addition to learning his planned list of characteristics, he also notes that the girl he is supposed to identify has long, brown hair.

Now that only one person in the picture fits the characteristics he learned, he is fairly sure that he will be able to identify the girl again, even if the scene the tester shows him next week is slightly different.

Since he still has a few moments left to look at the picture, he attempts to notice other, more subtle differences between the child he is supposed to remember and the others in the picture—just in case.

If the two similar children in the picture appeared to be identical twins, Alex might also take note of some less permanent feature of the child, such as the child’s position on the picnic blanket. That would enable him to identify the child if he were shown another picture in which the children were sitting on the blanket in the same order.

=============================================
Q. 44: What is the method used by QTP to learn objects?=============================================

QTP “looks” at the object being learned and stores it as a test object, determining in which test object class it fits. In the same way, Alex immediately checked whether the item was a person, animal, plant, or inanimate object. QTP might classify the test object as a standard Windows dialog box (Dialog), a Web button (WebButton), or a Visual Basic scroll bar object (VbScrollBar), for example.


Then, for each test object class, QTP has a list of mandatory properties that it always learns; similar to the list of characteristics that Alex planned to learn before seeing the picture. When QTP learns an object, it always learns these default property values, and then “looks” at the rest of the objects on the page, dialog box, or other parent object to check whether this description is enough to uniquely identify the object. If it is not, QTP adds assistive properties, one by one, to the description, until it has compiled a unique description; similar to when Alex added the hair length and color characteristics to his list. If no assistive properties are available, or if those available are not sufficient to create a unique description, QTP adds a special ordinal identifier, such as the object’s location on the page or in the source code, to create a unique description.

=================================
Q. 45: What is Test Object Methodin QTP?
=================================
It is a method that QTP recognizes as applicable to a particular test object. For example, the Click method is applicable to a WebButton test object. As you add steps to your test, you specify which method to perform on each test object. If you record steps, QTP records the relevant method as it is performed on an object.

During a run session, QTP performs the specified test object method on the run-time object. Run-time object methods are the methods of the object in your application as defined by the object creator. You can access and perform run-time object methods using the Object property.

=======================================
Q. 46: What are the Test object propertiesin QTP?=======================================
Test object properties are the properties whose values are captured from the objects in your application when QTP learns the object. QTP uses the values of these properties to identify run-time objects in your application during a run session.

Property values of objects in your application may change dynamically each time your application opens, or based on certain conditions. You may need to modify the test object property values to match the run-time object property values. You can modify test object properties manually while designing your test, or use SetTOProperty statements during a run session.

==================================================
Q. 47: How to decide on whether to save the objects in Local or Shared Object Repositories?
==================================================
Local object repository is easiest to use when you are creating simple tests, especially under the following conditions:
# You have only one, or very few, tests that correspond to a given application, interface, or set of objects.
# You do not expect to frequently modify object properties.
# You generally create single-action tests.

Shared object repository is the preferred option when:
# You are creating tests using keyword-driven methodologies (not by recording).
# You have several tests that test elements of the same application, interface, or set of objects.
# You expect the object properties in your application to change from time to time and/or you regularly need to update or modify object properties.
# You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

================================================
Q. 48: What are the possibilities of Exporting the data among various Object Repositories?
================================================
When QTP learns a test object, it adds it to the local object repository & not to the shared object repository — unless the same test object already exists in an associated shared object repository. (In this case, QTP uses the existing information in the shared object repository.)

You can export objects from the local object repository to a shared object repository. You can also export the local object repository and replace it with a shared object repository. This enables you to make the local objects accessible to other actions.

You can also merge objects from the local object repository directly to a shared object repository that is associated with the same action. This can help reduce maintenance since you can maintain the objects in a single shared location, instead of multiple locations.

===================================================
Q. 49: What is the effect of restoring Default Properties for a Test Object in QTP?===================================================
When you restore the default properties, it restores the mandatory property set defined for the selected object class in the Object Identification dialog box.

Any changes that you have made to the description property set for the test object will be overwritten. However, if property values were defined for any of the mandatory properties they are not modified.

========================================
Q. 50: What is the use of Ordinal Identifiers in QTP
========================================
An ordinal identifier assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties).

This ordered value provides a backup mechanism that enables QTP to create a unique description to recognize an object when the defined properties are not sufficient to do so. You can specify the ordinal identifier for test objects in the local object repository using the Object Repository window or Object Properties dialog box, and for test objects in the shared object repository using the Object Repository Manager.

Keyword: QTP Interview Questions, FAQ QTP

Author: "QTP Expert (noreply@blogger.com)" Tags: "Interview Questions - QTP"
Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader