Create a Schedule to Run QTP at a Desired Time

August 26, 2008

Every Microsoft Windows has a wonderful feature of “Task Scheduler”, which can be used for automatically running any application at any desired time, at desired frequency right from a specified date for initial launch. Once scheduling is done, it does not require any user intervention; however the only important thing to remember is that the PC must be kept on at the scheduled time.

This “Task Scheduler” utility is available in Windows “Control Panel” by the name “Scheduled Tasks”. Detailed steps are described as under.

1) Say our aim is to automatically run the file by the name QTP_Test.vbs available at the location C:\ExpertQTP\QTP_Test.vbs

2) Go to Windows “Control Panel” -> “Scheduled Tasks”.

3) Click on “Add Scheduled Task” in the “Scheduled Tasks”

4) This will start the “Scheduled Tasks Wizard”.

5) Click on “Next” – > Browse – > In “Select Program to Schedule” screen Go to the location of the QTP_Test.vbs file available in C:\ExpertQTP folder – > Click “Open” as described in the following picture.

6) In the “Scheduled Tasks Wizard” select the schedule for running the QTP Script. For example Daily, or Weekly or Monthly as per various options offered in the Wizard. In or example select say “Daily”. Then Click “Next” as described in the following picture.

7) Select the Time & day you want to start this Script. Then Click “Next” as described in the following picture.

8) Enter the “User Name” & Password for the workstation, just only once as described in the following picture.

This way wizard will not ask the user for his manual intervention of feeding the password every time.

9) Click “Finish”

10) Above mentioned simple steps shall now execute the desired script automatically, every day at 12.59PM starting from 07/13/2008.

Key Word: QTP, Quicktest, Automate, Schedule

How to Manage your Files using QTP

August 23, 2008

Sometimes as a QTP programmer, we may need to keep track about the files inside our Operating system. Apart from tracking our files, we need to manage them dynamically like files can be created, files can be read, files can be edited and deleted. In order to accomplish this task, we require FileSystemObject. It contains methods to carry all administrative tasks related to files.

Getting access of an already created file

For this, use the below written code.

Set obj=CreateObject(“Scripting.FileSystemObject”)

In order to run this code perfectly fine, the File “testfile.txt” should be present in the D:\ location else QTP will raise an error.

As you can see in the above mentioned code, we have provided the complete path for the file which we also call as Absolute path. Now this code is not of much use unless we do something more along with it. Like after getting the reference for a file, we can see the size of the file, its parent folder, its name etc.

Check for the existence of an already created file

Sometimes we may be interested in knowing whether our file exists or not. For this, we use “FileExists” method. This checks whether the files exists or not. The “FileExists” method requires a single argument containing the full path of the file. This method returns a boolean value. I hope you guys must be aware of what a boolean value is. Now this method will return a value “True” if the file exists and “False” if the file doesn’t exists.

The below mentioned code will explain in detail:

Set testobj = CreateObject(“Scripting.FileSystemObject”)
If test.FileExists(“D:\Expert\MyTestFile.txt”) Then
Set objFile = testobj.GetFile(“D:\Expert\MyTestFile.txt”)
MsgBox “The file doesn’t exist.”
End If

Deleting the File

We can delete a file by firstly creating an instance of FileSystemObject and then we need to call the DeleteFile method. Lets see the below mentioned code to explain this concept.

Set myobj = CreateObject(“Scripting.FileSystemObject”)

You can even delete your MS Word file with the above code. Cool na…. I know.

Let me show you something even more interesting. If the file is read-only, then the “DeleteFile” method will not be able to delete the file. So how to delete such a file? Any guesses.

This thing is left for you guys to find it out how we can delete a read only file.

Copy Files

Copying files from one location to another is also a very frequently done task. For this, we use CopyFile method. The syntax for copying files is:

obj.CopyFile “Source-File-Path”, “Destination-File-Path”

In order to copy a file from “C:\test.txt” to “D:\test.txt”, we will use the code:

Set obj=CreateObject(“Scripting.FileSystemObject”)
obj.CopyFile “C:\test.txt”, “D:\test.txt”

We can even rename a file just by changing the name of the file in the “Destination-File-Path”.

What happens if we try to copy a copy inside a folder and the folder doesnt exist? This thing is left for you guys to try.

Moving Files

We can also move files from one one location to another[Also known as Cut and Paste]. For this, we require MoveFile method. It is infact quite similar to CopyFile method.

We use the below code to move files from one location to another.

Set obj=CreateObject(“Scripting.FileSystemObject”)
obj.MoveFile “C:\test.txt”, “D:\test.txt”

Reading all contents of a file in a single shot

We can read all the contents of a file using the ReadAll method. It captures all the file contents and stores inside a variable.
The following code will help you in reading all contents of a file “D:\test.txt”.

Set obj1= CreateObject(“Scripting.FileSystemObject”)
Set obj2= obj1.OpenTextFile(“D:\test.txt”)
FileContents = obj2.ReadAll ‘Read all contents of the file
MsgBox FileContents ‘Display contents of file
obj2.Close ‘Close the File

Reading all contents of a file line by line

We can read all the contents of a file line by line. For this we require the ReadLine method.
The following code will help you in reading all contents of a file “D:\test.txt” line by line.

Set obj1= CreateObject(“Scripting.FileSystemObject”)
Set obj2= obj1.OpenTextFile(“D:\test.txt”)
Do Until obj2.AtEndOfStream
msgbox Line

All about Recovery Scenarios using QTP

August 23, 2008

Introduction to Recovery Scenarios:

While executing scripts, we usually encounter unexpected & unpredictable events & errors, which results into application crashing during a run session causing total disruption of the run session and distortion of results. Such problems are quite frequent especially when the tests are made to run unattended. In such a case the test process halts until the user perform some desired recovery operation.

Recovery scenarios are useful when it is difficult to predict at which step the errors can come or when we are confident that the error will not come in the QTP script, whereas it can be anywhere outside the QTP Script. For illustration; Pop-up message of “out of paper”, as caused by the printer device driver. “On error resume next” is preferred when we sure that the error is expected one and wish to perform some other actions.

In order to handle such situations QTP comes to our rescue by creating recovery scenarios and associates them with the particular tests. What does a Recovery Scenarios do is to activate a specific recovery operation when a trigger events takes place. Most simple example of a typical unexpected & unpredictable events & errors is like Incompatible Media in portable Drive.

The Recovery Scenario Manager presents a structured wizard which helps us in defining the recovery scenario, like detailed definition of the unexpected event and the operations required to recover from the exception during the run session.

Advantages of Recovery Scenario Manager: Recovery Scenario Manager can be used to handle several known errors occurring at runtime. Following four events available in the recovery scenario manager are extremely helpful

1) Application Crash: This event is useful in handling crashed applications at runtime.

2) Pop Up Window: This event is useful in managing various unwanted application windows, which get built-up at runtime.

3) Test Run Error: This event is useful in handling VBScript statement errors at runtime.

4) Object State: This event is useful in handling object related errors at runtime.

Elements of Recovery Scenario:
Steps to handle the exceptions are:

1) Trigger Event: Is an unexpected event like appearance of a Pop-up window, object state, test run error causing application crash or interruption in our running session.

2) Recovery Steps: Constitutes a series of steps required to be performed to enable QTP to proceed further with the process of test after some trigger event has interrupted the run session. Examples of a recovery operation can be 1) A keyboard or mouse Operation like a Click over the “OK” button in the Pop-up window 2) Close Application Process 3) Function Call 4) Restarting the OS etc.

3) Post-Recovery Test Run: Are a set of instructions designed to be provided to QTP on proceeding further with the test after some recovery operation has been carried out. Examples of Post Recovery actions can be repeating the complete test from the beginning or some steps may be skipped altogether & continuing with the remaining steps in the test.

QTP & Recovery Scenarios:

All Recovery scenarios get saved & logically grouped in recovery scenario files. Grouping of various recovery scenarios in recovery scenario file can be managed according the user requirements. Recovery scenario files carry a typical extension of .rs.

In order to instruct QTP to carry out a recovery scenario during a particular test run, we firstly associate it with the particular test. There is no limitation to any fixed number of recovery scenarios associated with a test. Order of execution of various recovery scenarios associated with a test can easily be prioritized, thereby the trigger events get recognized and handled in the desired sequence.

Whenever any error comes during the execution of a test having many recovery scenarios associated with it; QTP intelligently hunts for the defined trigger event which had caused the particular error. After detecting the trigger event, QTP automatically performs the desired recovery steps and post-recovery test runs etc.

Recovery statements can be inserted in the tests to comfortably control and activate the recovery scenarios during the test run.

Cons of Recovery Scenarios:

Although Recovery Scenarios are users friendly on one hand; they tend to slow down the speed of the Test Run. Presence of a few such recovery scenarios would reduce the speed of Test Run significantly. This can become irritant to the testers, who can prefer the approach of using VBScript On Error/Goto 0 far more useful for catching & handling small errors.

Keywords: QTP, Recovery Scenarios, errors, exception handling

Exploit the Power of MS Excel through QTP

August 13, 2008

The objective of this article is to briefly understand the process of interaction of MS Excel and VBScripts.

For automating an application a framework is created in the beginning. This requires an independent structure for reporting and data. Microsoft Excel plays a very important role in this framework approach.

We can easily use the built-in mechanism of QTP through which we can display the test results in a predefined format. A result sheet gets generated after the execution of the test in QTP; which provides an in-depth view of the script – through which we can know the various point of failures, warnings and the passes.

In the test script we create customize various checkpoints at our will. Likewise the result file can also be customized based upon the checkpoints already created according to the defined criterion of Pass / Fail.

Generally while working in MS Excel, the user desires to generate a detailed report of the entire test. The idea of generating such detailed / customized report is to have the output in a format as per our own choice and to preserve the file in a centralized location.

The entire process can be performed in following basic steps:

Step-1: Understanding the hierarchy of MS Excel Application.

Step-2: Creation of the desired Object in MS Excel

Step-3: Creation of a new MS Excel workbook or opening an existing one.

Step-4: Setting the objects for various sheets in the workbook.

Step-5: Writing and fetching the data values in the cells.

Step-6: Saving and closing of the workbook

Step-7: Closing the application and clearing the memory

The above steps can be explained through suitable illustrations to understand the approach properly.

Understanding the hierarchy of Excel Application

It is believed that the user is fairly acquainted with the basics of MS Excel like:

1) What is MS Excel Application

2) What are Workbooks in Excel

3) What are Sheets in Excel

4) What are Cells in Excel

Hence I am skipping the basic explanation of the above basics of MS Excel & directly moving on to the main content of our topic.

Some of the simple VBScripts are being described below for performing various actions in MS Excel.

Creation of an Object in Excel:

In the process of reporting it is the first step. In MS Excel the reporting can be done in two ways like 1) in the background wherein the application shall not be visible 2) the application can be made visible to the user once the process of writing or fetching the data is going on.

However in both the above mentioned methodologies we need to create objects in Excel Application for example:

Dim xl
Set xl = CreateObject(“Excel.Application”)

When we run the above script, we can see a process named “Excel.exe” in the Windows task Manager.

Creating a new workbook or Opening an existing one:

After creation of the object in Excel, it implies that Excel application has been invoked, however it is not visible. From now on we can either continue to perform the operations in the invisible back ground alternatively we can make the application visible and then we can perform the operations.

To make the application visible:
xl.visible = true

To open a new Workbook:

To open an existing Workbook:
xl.workbooks.Open(“File Name with complete path”)

Setting and accessing the objects of sheets in workbook:

After opening a workbook in Excel (A New one or opening an existing one), next activity is to feed some data in various cells in various sheets of our workbook.

MS Excel provides three sheets in a workbook by default, which are available to us for performing various operations. To access these sheets with great ease, we need to create objects referencing these sheets. This will help us in avoiding describing complete hierarchy time & again.

For example we wish to create a reference for a sheet with an index i, beginning from 1:
Set sht1 = xl.activeworkbook.sheets(i)

We can easily add or delete the desired sheets from the active workbook

To add a sheet in the workbook:

To delete a particular sheet: ( where i represents the index which begins from 1)

To change the name of the sheet:
xl.activeworkbook.sheeets(i).name = “Name of your choice”

To count total number of sheets in a workbook:
Countnt = xl.activeworkbook.sheets.count

Writing and fetching the data values in the cells:

To write the data in Excel sheet, we need to identify the Cell ID of the cell where the data is needed to be written. Similarly for accessing the data value from particular cells, we must know their Cell ID.

For an example we want to write some data in sheet2 cell ID as D8, the command can be written as under. Here “D” represents the Column Number & “8” represents the Row Number.

xl.activeworkbook.sheets(2).cells(8,4) = “hello”

To fetch the data from sheet3 cell ID A7:
Val = xl.activeworkbook.sheets(3).cells(7,1)

If an object has already been created in a particular sheet, we don’t have to repeat the complete hierarchy again, instead we can simply write:
Object.cells(row,col) = value

Saving and closing a workbook:

After finishing the work we can save the workbook to a desired location with a different name or save the changes made to an already existing open workbook.

To save the new workbook under a new name:
xl.activeworkbook.saveas “path_with_file_name.xls”

To save the changes made in an existing workbook:

To close a workbook:

Closing an application and clearing the memory:

To close the application:

To clear the memory from all objects:
Set xl = nothing

This is not the end; however it is just a beginning for us to explore the power of QTP in exploiting the potential of MS Excel through simple VBScripts.

Keywords: MS Excel, QTP, VBScript

Smart Identification: A Fantastic Feature of QTP

August 8, 2008

QTP has a unique feature by the name Smart Object Identification or recognition which is used for identifying the objects smartly, whenever the normal identification fails due to the dynamic changes in the properties of the objects.

Smart Identification is nothing but an algorithm used by the QTP when it is not able to recognize an object. A simple generic example as per the QTP manual would be, A photograph of a 8 year old girl and boy and QTP records identification properties of that girl when she was 8, now when both are 10 years old then QTP would not be able to recognize the girl. But there is something that is still the same, that is there is only one girl in the photograph. So a kind of PI – Programmed intelligence is needed instead of AI.

Object identification is necessary to recognize the GUI objects on the screen. During automatic recording of a script, the object identifier records various objects present on the screen. The smart identification feature of QTP smartly identifies all the objects irrespective of their being developed using same technology or not, e.g. smart identification shall be able to identify the objects in an application although developed in Java but using some of the Microsoft controls as well.

QTP identifies a particular object by comparing the properties of its test object and the run time object. QTP may not be able to recognize any dynamic objects whose properties or even the description may undergo some changes during the run time. Thus its great option of enabling Smart Identification helps us in identifying the objects even if their properties have undergone changes during the run time.

If QTP is not able to detect any object having description matching with that of the recorded object, or in case it detects more than one object having matching description, then QTP ignores the recorded description, and uses the Smart Identification feature to identify the object. Smart Identification mechanism is a bit complex, but flexible. However, if configured logically, Smart Identification definition can help QTP in detecting an object, of course – if present, in-spite of failure of the recorded description.

Understanding the Smart Identification Process: (Ref. Quick Test Professional 9.0 – Help Guide)

If QTP activates the Smart Identification mechanism during a run session (because it was unable to identify an object based on its learned description), 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 sufficient to identify the object, then QTP stops the run session and displays a Run Error message.

How to Analyze Smart Identification Information displayed in the Test Results?
(Ref. Quick Test Professional 9.0 – Help Guide)

If the recorded description does not enable QTP to identify the specified object in a particular step, and a Smart Identification definition is defined (and enabled) for the object, then QTP tries to identify the object using the Smart Identification mechanism. There are two possible scenarios.

Scenario –1: No Object Matches the Recorded Description

If QTP happens to successfully use the Smart Identification feature to recognize an object after no object found to match with the recorded description, the Test Results receive a warning status by providing the information like the following in the results details:

1) An indication that the object (for example, the userName WebEdit object) was not found.

2) An indication that the Smart Identification mechanism successfully found the object, and information about the properties used to find the object. You can use this information to modify the recorded test object description, so that QTP can find the object using the description in future run sessions.

3) Normal result details for the performed step.

The following screenshot displays the results for a test in which Smart Identification was used to identify the userName WebEdit object after one of the recorded description property values have changed.

Scenario –2: Multiple Object Match the Recorded Description

If QTP happens to successfully use the Smart Identification feature to recognize an object after multiple objects have been found to match the recorded description, QTP shows the Smart Identification information in the Test Results window. The step still receives a ‘Passed’ status, because in most of the cases, if Smart Identification was not used, the test object description plus the ordinal identifier could have potentially identified the object. In such a situation, the Test Results shows information like the following in the results details:

1) An indication that the Smart Identification mechanism has successfully found the object, and information about the properties used to find the object.

This information can be used to create a unique object description for the object, so that QTP can find the object using this description in the future run sessions.

2) Normal result details for the performed step.

The following screenshot displays the results for a test in which Smart Identification was used uniquely identifies the Home object after the recorded description resulted in multiple matches.

If the Smart Identification mechanism cannot successfully identify the object, the test fails and a normal failed step is displayed in the Test Results.

Smart Identification Feature of QTP uses two types of properties:

a) Base filter properties: Are the most fundamental properties of a particular test object class. Her we can not change their values without changing the essence of the original object.

b) Optional filter properties: Are other properties, which help us in identifying the objects of a particular class since these are not likely to get changed frequently. These properties can be ignored in case these are not applicable any more.

Smart Identification Example: (Ref. Quick Test Professional 9.0 – Help Guide)

The object identification process for an object is described through the following example in great detail.

Suppose you have the following statement in your test or component:

Browser(“Mercury Tours”).Page(“Mercury Tours”).Image(“Login”).Click 22,17

When you created your test or component, QTP learned the following object description for the Login image:

However, at some point after you created your test or component, a second login button (for logging into the VIP section of the Web site) was added to the page, so the Web designer changed the original Login button’s alt tag to: basic login.

The default description for Web Image objects (alt, html tag, image type) works for most images in your site, but it no longer works for the Login image, because that image’s alt property no longer matches the learned description. Therefore, when you run your test or component, QTP is unable to identify the Login button based on the learned description. However, QTP succeeds in identifying the Login button using its Smart Identification definition.

The explanation below describes the process that QTP uses to find the Login object using Smart Identification:

1) According to the Smart Identification definition for Web image objects, QTP learned the values of the following properties when you recorded the click on the Login image:

The learned values are as follows:

Base Filter Properties:
Property Value
html tag INPUT

Optional Filter Properties:

2) QTP begins the Smart Identification process by identifying the five objects on the Mercury Tours page that match the base filter properties definition (html tag = INPUT and image type = Image Button). QTP considers these to be the object candidates and begins checking the object candidates against the Optional Filter Properties list.

3) QTP checks the alt property of each of the object candidates, but none have the alt value: Login, so QTP ignores this property and moves on to the next one.

4) QTP checks the name property of each of the object candidates, and finds that two of the objects (both the basic and VIP Login buttons) have the name: login. QTP filters out the other three objects from the list, and these two login buttons become the new object candidates.

5) QTP checks the file name property of the two remaining object candidates. Only one of them has the file name login.gif, so QTP correctly concludes that it has found the Login button and clicks it.

How to Disable Smart Identification During the run Session:

Selection of the option “Disable Smart Identification during the run session”, Instructs QTP not to use the Smart Identification mechanism during the run session.

When we select this option, the Enable Smart Identification check boxes in the Object Properties and Object Repository dialog boxes get disabled, although the settings are saved. However when you clear this option, the Enable Smart Identification check boxes return to their previous on or off setting.

When should we use Smart Identification feature of QTP?

As per the suggested best practice we should disable Smart Identification while creating the test cases, so that we are able to recognize the objects which are dynamic or inconsistent in their properties. Moreover once the script gets created, the Smart Identification should be enabled, so that the script does not fail in case of any small change.

However the scriptwriter should always check for the test results to verify if the Smart Identification feature had been used to identify a object or not. Sometimes Smart Identification needs to be disabled for particular objects in the OR, this is advisable when you use SetTOProperty to change any of the TO properties of an object and especially ordinal identifiers like index, location and creation time.

Keywords: QTP, quicktest, hp, qtp smart identification

Creating MS Word document inside QTP

August 2, 2008

How many of you guys ever thought of creating a MS doc file with the help of QTP. It is in fact quite simple to create one. Let me show you a sample script of creating a very simple document in MS Word.

Dim obj_MSWord
Set obj_MSWord = CreateObject(“Word.Application”)
obj_MSWord.Selection.TypeText “This is a simple text”
obj_MSWord.ActiveDocument.SaveAs “D:\Expert.doc”

Now you will try to copy paste this code in your QTP but due to some formatting problems you may not get the proper format. Please take care of the quotes before Word.Application. These should be double quotes else your script wont run.

Think of this scenario . Lets say I have already opened MS Word document. Now I want to save it into my PC. The script is slightly different from the one shown above.Any idea what should be the code??

QTP Blog for Certification and Concepts

July 26, 2008

Dear Friends,

For real time concepts on quicktest professional, training , QTP scripts and Certification Material, you can visit . The posts are updated regularly. If anyone would like to contribute, please feel free to contact me. Refer my blog for contact details..

Blog Address

For basic tutorials on QTP, you can visit

Keywords: QTP, quicktest, hp, qtp certification, quicktest professional, qtp training, qtp help, checkpoint, data table

QTP Download

July 21, 2008

Hi All,

You can download QTP from here:

Keywords: QTP, download QTP, QuickTest Professional, QTP help, QTP features, QTP Certification

QTP Certification Practice Questions Part2

July 8, 2008

Do you have some better article to contribute related to QTP? If yes, then mail me on
Names of contributors will also be published along with the post.

I will post the answers once you guys actually try it on your own

1. The toolbar enables you to view the details of an individual action or the entire test flow is:
A. Testing toolbar
B. None of the above
C. Action toolbar
D. Test Pane

2. The key that is used to Start/End analog recording mode ?
A. F3
D. F10

3. QuickTest supports virtual object for analog or low-level recording.
A. False
B. True

4. To use a specific property to identify your object, but that property is not listed in the properties list. Then how do you identify that object?
A. Add the specific property to the list
B. Use the Default property
C. Use some other property to identify your object

5. The checkpoint used to check the alt attribute exists for all relevant objects (such as images) is
A. Database CheckPoint
B. Accessibility checkpoint
C. Bitmap checkpoint
D. Standard checkpoint

6. Bitmap checkpoint is supported in VB environment.
A. True
B. False

7. Can we parameterize the checkpoints properties?
A. No
B. Yes

8. What is the shortcut key that is used for a Standard Checkpoint?
A. F12
B. F2
C. F10
D. F7

9. Can we change name of checkpoint?
A. No
B. Yes

10. To compare the values of the specified property during a run session with the values stored for the same test object property within the test.
A. Checkpoint
B. All the above
C. Output Value
D. Compare the object property

11. You will use which recording mode for an object not recognized by QuickTest?

A. Low-Level Recording Mode
B. Normal recording Mode
C. Analog Mode

12. The statement that calls the recorded analog file is:
A. RunAnalog
B. CallAnalog
C. ExecuteAnalog

13. An action can be called by other tests or actions is:
A. Call Action
B. Split Action
C. Reusable Action

14. You can replace the page in your Active Screen tab:
A. False
B. True

15. QuickTest adds a checkpoint statement in the Expert View as:
A. Check Checkpoint
B. Checkpoint

16. A Checkpoint checks that a text string is displayed within a defined area in a Windows application is:
A. Accessibility
B. Text Area
C. Standard
D. Text

17. In ACTIVE X environment, an ACCESSIBILITY checkpoint is supported?
A. No
B. Yes

18. Can we get the execution time for an action in a Test?
A. Yes
B. No

19. Can we add external library files in QTP?
1. No
2. Yes

20. The method used to get data from HTML Table is
A. GetData(Row,Col)
B. GetRowValue(Rowid,Colname)
C. GetCellData (Row,Col)

21. The Command used to insert the transactions in test is:
A. StartTransaction(Name), EndTransaction(Name)
B. Services.StartTransaction “Name”, Services.EndTransaction “Name”
C. “Name, “Name”

22. A step in which one or more values are captured at a specific point in your test and stored for the duration of the run session is:
A. Output Value
B. Checkpoints
C. Active Screen

23. QuickTest can detects an application crash and activate a defined recovery scenario to continue the run session.
A. True
B. false

24. In Batch Test process, the test list are saved in file format as:
A. *.mtb
B. *.mts
C. *.mbt
D. *.mtr

25. The command used to invoke other application from QTP:
A. InvokeApplication
B. SystemUtil.Run
C. Run
D. Both b & c
E. Both a & b

26. The command used to retrieve data from excel sheet is
A. Set ab = Connection(“srcfilepath “) , Set ws = ab.getdata(sheetid)
B. Set ab = CreateObject(“srcfilepath “) , Set ws = ab.getsheet(sheetid)
C. Set ab = GetObject(“srcfilepath”) , Set ws = ab.worksheets(sheetid)

27. The method that explicitly activates the recovery scenario mechanism is:
A. recovery.activate
B. enable
C. recovery.enable
D. activate

28. The method used for sending information to the test results is:
A. Reporter.log()
B. Reporter.reportevent()
C. Reporter.msgbox()

29. To terminate an application that is not responding we use:
A. SystemUtil.terminate
B. SystemUtil.Stop
C. SystemUtil.CloseProcessByName

30. The recovery mechanism does not handle triggers that occur in the last step of a test:
A. false
B. True

31. We can add Test object methods, function calls into the Test using:
A. Function generator
B. Step generator
C. Object repository

32. The method that adds to the test while implementing synchronization is:
A. Synchronize
B. Wait
C. WaitProperty
D. Pause

33. The mechanism used to identify objects during run session is:
A. Recovery scenario
B. Smart identification
C. Handling object

34. Post-recovery test run options specifies:
A. how to continue the run session after QTP identify the event
B. errors while running
C. recovery scenario during a run session

35. The action that can be called multiple times by the test as well as by other tests is called:
A. non-reusable action
B. Reusable action
C. External action

36. The command used to connect with Database is:
A. Createobject(connectivity name)
B. dbconnect(connectivity name)
C. open(connectivity name)
D. None of the above

37. The method used to retrieve the folders is:
A. FileSystemObject.Getfolder()
B. FileSystemObject.selectfolder()
C. FileSystemObject.retrievefolder()

38. The method used to compare 2 XML files is:
B. XMLcompare(file1,file2)
C. compare(XMLfile1,XMLfile2)

39. The QTP script files are stored in the extension of:
A. *.mts
B. *.usr
C. *.mtr
D. *.vbs

40. The method used to register the user-defined function with test object is:
A. setFunc()
B. RegisterUserFunc()
C. RegisterFunc()

41. The method used to open the specified URL in a browser is:
A. openURL()
B. navigateURL()
C. navigate()

42. The 3 Parameter types available in data driver is:
A. DataTable,Environment,Random number
B. DataTable,random number,unique
C. environment,string,numeric

43. The method added to the test while parameterizing is:
A. get Data (variable, dtGlobalSheet)
B. get DataTable(variable, dtGlobalSheet)
C. Set Data(variable, dtGlobalSheet)
D. Set DataTable(variable, dtGlobalSheet)

44. The length of the array can be get by the method:
A. length(array)
B. ubound(array)
C. count(array)

45. The method used to get the count value of list box or combo box is:
A. GetItemsCount
B. GetCount
C. GetItemCount

46. To retrieve the current the objects in your application during the run session:
A. GetVisibleText
B. GetROProperty
C. SetROProperty
D. GetTOProperty

47. The list of test objects and their properties and values are stored in the:
A. Object Repository
B. Object Identification

48. The method used to continue the test execution after getting run-time error is:
1. On Error Resume Next
2. On Error Raise Next
3. On Error Next

Please post your answers in the chat box. Then I will post you my answers.

Keywords: QTP Certification, QTP sample questions, QTP Features, quicktest, quick test professional, hp

Challenges in Regression Testing- Why we go for Automation

July 6, 2008

Challenges in Regression Testing

Eventually, in any software system, users may defects or we can say bugs in the
developed program. Normally, these bugs are fixed, the fixes are then tested, and the updated
software is released back to the users . However, since the software is so tightly coupled or we can due to the interconnected nature of software, even the smallest change can wreak
unpredictable havoc when the implications of that change are not properly understood.

Any software change, even one that corrects a known defect, can affect
a system in an unforeseen manner and potentially cause problems that are worse
than those that the change was originally trying to address.

Regression testing is the practice of retesting of a software system that has been
modified to ensure that no previously-working functions have failed as a result of
defect reparations or newly added functionality.

Comprehensive regression testing fully ensures that a software system is functioning as designed. Comprehensive regression testing, however, is rarely feasible, given the time and resource constraints placed on the typical software development team.

As a software system expands and evolves, it becomes more and more difficult to test every piece of functionality. This problem is compounded by the frequency of software builds. In an
environment where software builds are done on a nightly basis, comprehensive
regression testing of every build is essentially impossible. Typically, in these
environments, the testing of previous functionality is foregone to allow for testing of
new fixes and new functionality. This leaves open the possibility that the software
team will release software with undiscovered defects.

Hence we go for an Automation tool that helps us in addressing these challenges. Through an Automation tool, we create scripts and which are quite helpful in retesting the original system’s functionality. Every time we get a new build, we execute the created automation scripts to check the previous working functionality. And the most important benefit of automation is that we can execute scripts in an unattended mode means it frees QA persons to do other important tasks while the scripts are running automatically.

Please post your comments in the Chat box….