55
1. How to handle the exceptions using recovery scenario manager in QTP? You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run 2. What is the use of Text output value in QTP? Output values enable to view the values that the application talks during run time. When parameterized, the values change for every iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table. 3. How to use the Object spy in QTP? There are two ways to Spy the objects in QTP 1) Thru file toolbar ---In the File Tool Bar click on the last toolbar button (an icon showing a person with hat). 2) Thru Object repository Dialog ---In Object repository dialog click on the button “object spy...” In the Object spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object If at all the object is not visible or window is minimized then Hold the Ctrl button and activate the required window to and release the Ctrl button. 4. What is the file extension of the code file & object repository file in QTP? File extension of -- Per test object rep: - filename.mtr -- Shared Object rep: - filename.tsr -- Codes file extension id: - script.mts 5. Explain the concept of object repository & how QTP recognizes objects? Object Repository: displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected).

QTP Interview Questions

Embed Size (px)

Citation preview

Page 1: QTP Interview Questions

1. How to handle the exceptions using recovery scenario manager in QTP?

You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run

2. What is the use of Text output value in QTP?

Output values enable to view the values that the application talks during run time. When parameterized, the values change for every iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.

3. How to use the Object spy in QTP?

There are two ways to Spy the objects in QTP 1) Thru file toolbar ---In the File Tool Bar click on the last toolbar button (an icon showing a person with hat). 2) Thru Object repository Dialog ---In Object repository dialog click on the button “object spy...” In the Object spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object If at all the object is not visible or window is minimized then Hold the Ctrl button and activate the required window to and release the Ctrl button.

4. What is the file extension of the code file & object repository file in QTP?

File extension of -- Per test object rep: - filename.mtr -- Shared Object rep: - filename.tsr -- Codes file extension id: - script.mts

5. Explain the concept of object repository & how QTP recognizes objects?

Object Repository: displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected).

We can view or modify the test object description of any test object in the repository or to add new objects to the repository.

Quick test learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.

Page 2: QTP Interview Questions

6. What are the properties you would use for identifying a browser & page when using descriptive programming?

"Name" would be another property apart from "title" that we can use. OR We can also use the property "micClass". Ex: Browser("micClass:=browser").page("micClass:=page")....

7. What are the different scripting languages you could use when working with QTP?

Visual Basic (VB), XML, JavaScript, Java, HTML

8. Give example where you have used a COM interface in your QTP project?

COM interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).

9. Few basic questions on commonly used Excel VBA functions?

Common functions are: Coloring the cell Auto fit cell Setting navigation from link in one cell to other Saving

10. Explain the keyword create object with an example.

Creates and returns a reference to an Automation object Syntax: CreateObject(servername.typename [, location]) Arguments SERVERNAME: Required. The name of the application providing the object TYPENAME: Required. The type or class of the object to create LOCATION: Optional. The name of the network server where the object is to be created

11. Explain in brief about the QTP Automation Object Model.

Essentially all configuration and run functionality provided via the QTP interface is in some way represented in the QTP automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QTP have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QTP automation object model, along with standard programming elements such as loops and conditional statements to design your program.

Page 3: QTP Interview Questions

12. How to handle dynamic objects in QTP?

QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognize the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. Check this out-

If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object. While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails. The Smart Identification mechanism uses two types of properties: Base filter properties—the most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value; you could no longer call it the same object. Optional filter properties—other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.

13. What is a Run-Time Data Table? Where can I find and view this table?

In QTP, there is data table used, which is used at runtime. -In QTP, select the option View->Data table. -This is basically an excel file, which is stored in the folder of the test created, its name is Default.xls by default.

14. How does Parameterization and Data-Driving relate to each other in QTP?

To data drive we have to parameterize i.e. we have to make the constant value as parameter, so that in each iteration (cycle) it takes a value that is supplied in run-time data table. Through parameterization only we can drive a transaction (action) with different sets of data. You know running the script with the same set of data several times is not suggestible, & it's also of no use.

15. What is the difference between Call to Action and Copy Action.?

Call to Action: The changes made in Call to Action, will be reflected in the original action (from where the script is called).

But where as in Copy Action, the changes made in the script, will not affect the original script (Action)

16. Discuss QTP Environment.

QuickTest Pro environment using the graphical interface and Active Screen technologies –

A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.

Page 4: QTP Interview Questions

 17. Explain the concept of how QTP identifies object.

During recording QTP looks at the object and stores it as test object. For each test object QT learns a set of default properties called mandatory properties, and look at the rest of the objects to check whether this properties are enough to uniquely identify the object. During test run, QT searches for the run time objects that match with the test object it learned while recording.

18. Differentiate the two Object Repository Types of QTP.

Object repository is used to store all the objects in the application being tested. 2 types of object repository per action and shared. In shared repository only one centralized repository for all the tests, where as in per action for each test a separate per action repository is created.

19. What the differences are and best practical application of each.

Per Action: For Each Action, one Object Repository is created.

Shared: One Object Repository is used by entire application

20. Explain what the difference between Shared Repository and Per_Action Repository

Shared Repository: Entire application uses one Object Repository, that similar to Global GUI Map file in WinRunner

Per Action: For each Action, one Object Repository is created, like GUI map file per test in WinRunner

21. Have you ever written a compiled module? If yes tell me about some of the functions that you wrote.

I used the functions for capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages.

22. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them.

PBS: WR fails to identify the object in GUI. If there is a non standard window object cannot recognize it, we use GUI SPY for that to handle such situation.

23. Can you do more than just capture and playback?

I have done dynamically capturing the objects during runtime in which no recording, no playback and no use of repository is done AT ALL.

-It was done by the windows scripting using the DOM (Document Object Model) of the windows.

Page 5: QTP Interview Questions

24. How to do the scripting. Are there any inbuilt functions in QTP as in QTP-S.? What is the difference between them? How to handle script issues?

Yes, there's an in-built functionality called "Step Generator" in Insert->Step->Step Generator -F7, which will generate the scripts as u enter the appropriate steps.

25. What is the difference between check point and output value.

I would like to add some stuff to Kalpana's comments. It is as follows:- An outPut value is a value captured during the test run and entered in the run-time but to a specified location.

EX:-Location in Data Table [Global sheet / local sheet]

26. IF we use batch testing the result shown for last action only in that how can i get result for every action.

u can click on the icon in the tree view to view the result of every action.

27. How the exception handling can be done using QTP

It can be done using the Recovery Scenario Manager which provides a wizard that guides you through the process of defining a recovery scenario. FYI The wizard could be accessed in QTP> Tools-> Recovery Scenario Manager.......

28. How many types of Actions are there in QTP?

There are three kinds of actions: Non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once.

Reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests.

External action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.

29. I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well. How do I do this?  

U can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad "( i.e., where the notepad.exe is stored in the system) in the "Windows Applications Tab" of the "Record and Run Settings window. Try it out.

Page 6: QTP Interview Questions

30. 1. What are the Features & Benefits of Quick Test Pro(QTP)..?

1. Key word driven testing 2. Suitable for both client server and web based application 3. VB script as the script language 4. Better error handling mechanism 5. Excellent data driven testing features

QTP Testing process

1. Analyzing your application

The first step in planning your test is to analyze your application to determine your testing needs.

What are your application's development environments (for example Web, Java, or .NET)? You will need load QTP add-ins for these environments to enable QTP to identify and work with the objects in your application

What business processes and functionality do you want to test? To answer this, think about the various activities that customers perform in your application to accomplish specific tasks.

Consider how to divide these business processes into smaller units. You will be creating actions based on these tasks. Smaller and more modular actions make your tests easier to read and follow, and help ease maintenance in the long run. At this stage, you can already begin creating test skeletons and adding actions to them.

2. Preparing the testing infrastructure

Based on your testing needs, you determine what resources are required and create these resources, accordingly. Resources include shared object repositories containing test objects (which are representations of the objects in your application), function libraries containing functions that enhance QTP functionality, and so on.

You also need to configure QTP settings so that QTP will perform the tasks you need, such as displaying a results report every time you run a test.

3. Building your tests and adding steps to them

After the testing infrastructure is ready, you can begin building your tests. You can create one or more empty tests and add actions to them to create the testing skeletons. You associate your object repositories with the relevant actions, and associate your function libraries with the relevant tests, so that you can insert steps using keywords. You may also need to configure test preferences at this point.

Page 7: QTP Interview Questions

4. Enhancing your test

Inserting checkpoints into your test lets you search for a specific value of a page, object, or text string, which helps you determine whether your application is functioning correctly.

Broadening the scope of your test, by replacing fixed values with parameters, lets you check how your application performs the same operations with multiple sets of data.

Adding logic and conditional or loop statements enables you to add sophisticated checks to your test

. 5. Debugging, running, and analyzing your test

You debug a test to ensure that it operates smoothly and without interruption. After the test is working correctly, you run it to check the behaviour of your application. While running, QTP opens the application and performs each step in your test.

You examine the test results to pinpoint defects in your application.

5. Reporting defects

If you have Quality Center installed, you can report the defects you discover to a database. Quality Center is the HP test management solution.

31. What is Software Testing?

Operation of a system or application under controlled conditions and evaluating the results. The controlled conditions must include both normal and abnormal conditions. It is oriented to detection.

32. . What is Software Quality Assurance?

Software QA involves the monitoring and improving the entire software development process, making sure that any agreed-upon standards and procedures are followed. It is oriented to prevention

33. What are the qualities of a good test engineer?

A good test engineer has a test to break attitude.

An ability to take the point of view of the customer

a strong desire for quality

Tactful and diplomatic

Good communication

Page 8: QTP Interview Questions

skills

Previous software development experience can be helpful as it provides a deeper understanding of the

software development process

Good judgment skills

34. What are the qualities of a good QA engineer?

The same qualities a good testerAdditionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization.In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed.An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.

35. What are the qualities of a good QA or Test manager?

Must be familiar with the software development processable to maintain enthusiasm of their team and promote a positive atmospherealways looking for preventing problemsable to promote teamwork to increase productivityable to promote cooperation between software, test, and QA engineershave the skills needed to promote improvements in QA processeshave the ability to say 'no' to other managers when quality is insufficient or QA processes are not being adheredhave people judgement skills for hiring and keeping skilled personnelbe able to run meetings and keep them focused

36. What is the 'software life cycle'?

. The life cycle begins when an application is first conceived and ends when it is no longer in use. 

37. Tell us about some world famous bugs?

1. In December of 2007 an error occurred in a new ERP payroll system for a large urban school system. More than one third of employees had received incorrect paychecks that results in overpayments of $53 million. Inadequate testing reportedly contributed to the problems

2. A software error reportedly resulted in overbilling to 11,000 customers of a major telecommunications company in June of 2006. Making the corrections in the bills took a long time.

3. In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges

Page 9: QTP Interview Questions

38. What are the common problems in the software development process?

Poor requirementsUnrealistic scheduleInadequate testingA request to pile on new features after development is unnderway.Miscommunication

39. What are the common solutions to software development problems?

Solid requirementsRealistic schedulesAdequate testingstick to initial requirements where feasiblerequire walkthroughs and inspections when appropriate

40. What is a Quality Software?

Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and / or expectations, and is maintainable.

41. What is good code?

Good code is code that works, is reasonably bug free, and is readable and maintainable.

42. What is good design?

Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable. It should also be robust with sufficient error-handling and status logging capability and work correctly when implemented. And, good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements.

43. What's the role of documentation in QA?

QA practices must be documented to enhance their repeatability. There should be a system for easily finding and obtaining information and determining what documentation will have a particular piece of information.

44. Which projects may not need independent test staff?

It depends on the size & nature of the project. Then, it depends on business risks, development methodology, the skills and experience of the developers.

45. Why does software have bugs?

miscommunication or no communicationsoftware complexity

Page 10: QTP Interview Questions

programming errorschanging requirementstime pressurespoorly documented codesoftware development toolsegos - people prefer to say things like:• 'no problem'

• 'piece of cake'• 'I can whip that out in a few hours'

46.How QA processes can be introduced in an organization?

1. It depends on the size of the organization and the risks involved. e.g. for large organizations with high-risk projects a formalized QA process is necessary.

2. If the risk is lower, management and organizational buy-in and QA implementation may be a slower.

3. The most value for effort will often be in

- Requirements management processes- Design inspections and code inspections- post-mortems / retrospectives

47. What are the steps to perform software testing?

Understand requirements and business logic- Get budget and schedule requirements- Determine required standards and processes- Set priorities, and determine scope and limitations of tests- Determine test approaches and methods- Determine test environment, test ware, test input data requirements- Set milestones and prepare test plan document- Write test cases- Have needed reviews/inspections/approvals of test cases- Set up test environment- Execute test cases- Evaluate and report results- Bug Tracking and fixing- Retesting or regression testing if needed- Update test plans, test cases, test results, traceability matrix etc.

48. What is a test plan?

A document that describes the objectives, scope, approach, and focus of a software testing effort.

49. What are the contents of test plan?.

Page 11: QTP Interview Questions

- Title and identification of software including version etc.- Revision history- Table of Contents- Purpose of document and intended audience- Objective and software product overview- Relevant related document list and standards or legal requirements- Naming conventions- Overview of software project organization- Roles and responsibilities etc.- Assumptions and dependencies- Risk analysis- Testing priorities- Scope and limitations of testing effort- Outline of testing effort and input data- Test environment setup and configuration issues- Configuration management processes- Outline of bug tracking system- Test automation if required- Any tools to be used, including versions, patches, etc.- Project test metrics to be calculated- Testing deliverables- Reporting plan- Testing entrance and exit criteria- Sanity testing period and criteria- Test suspension and restart criteria- Personnel pre-training needs- Relevant proprietary, classified, security and licensing issues.- Open issues if any- Appendix

50. What is a test case?

Ans. A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of a software application is working correctly.

51. What are the components of a bug report?

- Application name- The function, module, name- Bug ID- Bug reporting date- Status- Test case ID- Bug description- Steps needed to reproduce the bug- Names and/or descriptions of file/data/messages/etc. used in test- Snapshot that would be helpful in finding the cause of the problem- Severity estimate- Was the bug reproducible?- Name of tester- Description of problem cause (filled by developers)- Description of fix (filled by developers)

Page 12: QTP Interview Questions

- Code section/file/module/class/method that was fixed (filled by developers)- Date of fix (filled by developers)- Date of retest or regression testing- Any remarks or comments

52. What is verification?

. It involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. It can be done with checklists, issues lists, walkthroughs, and inspection meetings etc.

53. What is validation?

It involves actual testing and takes place after verifications are completed.

54. What is a walkthrough?

An informal meeting for evaluation or informational purposes.

55. What's an inspection?

It is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the purpose is to find problems and see what's missing, not to fix anything.

56. What is configuration management?

It covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools / compilers / libraries / patches, changes made to them, and who makes the changes.

57. When you can stop testing?

Deadlines (release deadlines, testing deadlines, etc.)- Test cases completed with certain percentage passed- Test budget depleted- Coverage of code/functionality/requirements reaches a specified point- Bug rate falls below a certain level Beta or alpha testing period ends

Page 13: QTP Interview Questions

58. What if there isn't enough time for thorough testing?

- Which parts of the application were developed in rush?-Which aspects of similar/related previous projects caused problems?- What do the developers think are the highest-risk aspects of the application?- What kinds of problems would cause the worst publicity?- What kinds of problems would cause the most customer service complaints?- What kinds of tests could easily cover multiple functionalities?

59. What if the project isn't big enough to justify extensive testing?

Do risk analysis. See the impact of project errors, not the size of the project.

60. How can web based applications be tested?

Ans. Apart from functionality consider the following:

- What are the expected loads on the server and what kind of performance is expected on the client side?- Who is the target audience?- Will down time for server and content maintenance / upgrades be allowed?- What kinds of security will be required and what is it expected to do?- How reliable are the site's Internet / intranet connections required to be?- How do the internet / intranet affect backup system or redundant connection requirements and testing?- What variations will be allowed for targeted browsers?- Will there be any standards or requirements for page appearance and / or graphics throughout a site or parts of a site?- How will internal and external links be validated and updated?- How are browser caching and variations in browser option settings?- How are flash, applets, java scripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?- From the usability point of view consider the following:

-- Pages should be 3-5 screens longer.-- The page layouts and design elements should be consistent throughout the application / web site.--Pages should be as browser-independent or generate based on the browser-type.--There should be no dead-end pages. A link to a contact person or organization should be included on each page.

61. What is Extreme Programming?

Extreme Programming is a software development approach for risk-prone projects with unstable requirements. Unit testing is a core aspect of Extreme Programming. Programmers write unit and functional test code first - before writing the application code. Generally, customers are expected to be an integral part of the project team and to help create / design scenarios for acceptance testing.

Page 14: QTP Interview Questions

62. Explain the check points in QTP?

A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.

- A page checkpoint checks the characteristics of a Application.- A text checkpoint checks that a text string is displayed in the appropriate place on a Application.- An object checkpoint (Standard) checks the values of an object on a Application.- An image checkpoint checks the values of an image on a Application.- A table checkpoint checks information within a table on a Application.- An Accessibility checkpoint checks the web page for Section 508 compliance.- An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.- Adatabase checkpoint checks the contents of databases accessed by your web site.

63. In how many ways we can add check points to an application using QTP.

We can add checkpoints while recording the application or we can add after recording is completed using Active screen

(Note : To perform the second one The Active screen must be enabled while recording).

64. How does QTP identifies the object in the application?

QTP identifies the object in the application by Logical Name and Class.

65. If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?

QTP handles those situations using "Regular Expressions".

66. What is Parameterizing Tests?

When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.

67. What is test object model in QTP?

The test object model is a large set of object types or classes that QuickTest 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 record for it.

Page 15: QTP Interview Questions

A test object is an object that QuickTest creates in the test or component to represent the actual object in your application. QuickTest stores information about 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 Web site or application on which methods are performed during the run session.

When you perform an operation on your application while recording, QuickTest identifies the test object class that represents the object on which you performed the operation and creates the appropriate test object reads the current value of the object's properties in your application and stores the list of properties and values with the test object chooses a unique name for the object, generally using the value of one of its prominent properties records the operation that you performed on the object using the appropriate QuickTest test object method. For example, suppose you click on a Find button with the following HTML source code:

<INPUT TYPE="submit" NAME="Find" VALUE="Find">

QuickTest identifies the object that you clicked as a WebButton test object. It creates a WebButton object with the name Find, and records the properties and values for the Find WebButton. It also records that you performed a Click method on the WebButton. QuickTest displays your step like this:

Browser("Mercury Interactive").Page("Mercury Interactive").WebButton("Find").Click

68 What is the Diff between Image check-point and Bit map Check point?

Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. 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 bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins is loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

69. How many ways we can parameterize data in QTP?

There are four types of parameters:

- Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.

- Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.

Page 16: QTP Interview Questions

- Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.

- Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit field.

70. How do u do batch testing in WR & is it possible to do in QTP, if so explain?

Batch Testing in WR is nothing but running the whole test set by selecting "Run Testset" from the "Execution Grid". The same is possible with QTP also. If our test cases are automated then by selecting "Run Testset" all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in "Waiting" mode.

71. What does it mean when a check point is in red color? what do u do?

A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue.

72. What do you call the window test director - testlab?

Execution Grid". It is place from where we Run all Manual / Automated Scripts.

73. How does u create new test sets in TD?

- Login to TD.- Click on "Test Lab" tab.- Select the Desired folder under which we need to Create the Test Set. (Test Sets can be grouped as per module.)- Click on "New Test Set or Ctrl+N" Icon to create a Test Set.

74. How do u do batch testing in WR & is it possible to do in QTP, if so explain?

Ans : You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location.

Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run.

Page 17: QTP Interview Questions

75. How to Import data from a ".xls" file to Data table during Runtime?

Datatable.Import "...XLS file name..." - DataTable.ImportSheet(FileName, SheetSource, SheetDest) - DataTable.ImportSheet "C:\name.xls" ,1 ,"name"

76. How to export data present in Datatable to an ".xls" file?

DataTable.Export "....xls file name..."

77. Syntax for how to call one script from another and Syntax to call one "Action" in another?

RunAction ActionName, [IterationMode , IterationRange , Parameters]

Here the actions become reusable on making this call to any Action.IterationRange String Not always required. Indicates the rows for which action iterations will be performed. Valid only when the IterationMode is rngIterations. Enter the row range (i.e. "1-7"), or enter rngAll to run iterations on all rows.If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument.

78. How to export QTP results to an ".xls" file?

By default it creates an "XML" file and displays the results.

79. Differences between QTP & Winrunner?

- QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting.- QTP supports ".NET" application Automation not available in Winrunner.- QTP has "Active Screen" support which captures the application, not available in WR.- QTP has "Data Table" to store script values , variables which WR does not have.Using a "point and click" capability you can easily interface with objects, their definitions and create checkpoints after having recorded a script without having to navigate back to that location in your application like you have to with WinRunner. This greatly speeds up script development.

80. How to add a runtime parameter to a datasheet?

By using LocalSheet property. The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it:

MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45")

Page 18: QTP Interview Questions

81. What scripting language is QTP of?

VB Script.

82. Analyzing the Checkpoint results

Standard Checkpoint: By adding standard checkpoints to your tests or components, you can compare the expected values of object properties to the object's current values during a run session. If the results do not match, the checkpoint fails.

83. Table and DB Checkpoints:

By adding table checkpoints to your tests or components, you can check that a specified value is displayed in a cell in a table on your application. By adding database checkpoints to your tests or components, you can check the contents of databases accessed by your application.

The results displayed for table and database checkpoints are similar. When you run your test or component, QuickTest compares the expected results of the checkpoint to the actual results of the run session. If the results do not match, the checkpoint fails.

You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component. For ActiveX tables, you can also check the properties of the table object. To add a table checkpoint, you use the Checkpoint Properties dialog box.

Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments.

You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to detect defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query.

Database checkpoints are supported for all environments supported by QuickTest, by default, as well as for a variety of external add-in environments.

There are two ways to define a database query:

- Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office.- Manually define an SQL statement.

The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint.

84. Checking Bitmaps:

You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an

Page 19: QTP Interview Questions

entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space.

When you run the test or component, QuickTest compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QuickTest 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.

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 bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins is loaded).

Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

85. Text/Text Area Checkpoint:

In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions.

Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint.

QTP automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed).

To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens.

86. Checking XML:

XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data.

XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.

You can verify the data content of XML files by inserting XML checkpoints. A few common uses

Page 20: QTP Interview Questions

of XML checkpoints are described below:

- An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another.

- An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.

- XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way.

- XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.

87. Object Repositories types, which & when to use?

To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run 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 test object properties.

- You generally create single-action tests.

Conversely, the shared object repository mode is generally the preferred mode when:

- 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 test object properties.

- You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

88. Can we Script any test case with out having Object repository? or Using Object Repository is a must?

Page 21: QTP Interview Questions

No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.

89. How to execute a WinRunner Script in QTP?

TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward compatibility

Parameters: The test set within Quality Center , in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center project. When the test is not saved in Quality Center , this parameter is ignored.e.g : TSLTest.RunTest "D:\test1", ""

(b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue"CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends.Parameters : Up to 15 WinRunner function argument

90. How to handle Run-time errors?

On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext

91. How to change the run-time value of a property for an object?

SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set.

92. How to retrieve the property of an object?

using "GetRoProperty".

93. How to open any application during Scripting?

SystemUtil, object used to open and close applications and processes during a run session. A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a testE.g : SystemUtil.Run "Notepad.exe"

Page 22: QTP Interview Questions

SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)

94. Types of properties that Quick Test learns while recording?

Ans : (a) Mandatory (b) Assistive .

In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

95. What is the extension of script and object repository files?

Object Repository : .tsr , Script : .mts, Excel : Default.xls

96. How to supress warnings from the "Test results page"?

From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

97. When we try to use test run option "Run from Step", the browser is not launching automatically why?

This is default behaviour.

98. How to "Turn Off" QTP results after running a Script?

Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.

99. How to verify the Cursor focus of a certain field?

Use "focus" property of "GetRoProperty" method"

Page 23: QTP Interview Questions

100. How to make arguments optional in a function?

Ans : this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required.

101. How to covert a String to an integer?

CInt()---> a conversion function available.

102. Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

Inserting a call to action will only Import the columns of the Action called

103. What kinds of testing should be considered?

• Black box testing – not based on any knowledge of internal design or code. Tests are based on requirements and functionality.

• White box testing - based on knowledge of the internal logic of an application's code. Tests are based on coverage of code statements, branches, paths, conditions.

• unit testing - the most 'micro' scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.

• incremental integration testing - continuous testing of an application as new functionality is added; requires that various aspects of an application's functionality be independent enough to work separately before all parts of the program are completed, or that test drivers be developed as needed; done by programmers or by testers.

• integration testing - testing of combined parts of an application to determine if they function together correctly. The 'parts' can be code modules, individual applications, client and server applications on a network, etc. This type of testing is especially relevant to client/server and distributed systems.

• functional testing - black-box type testing geared to functional requirements of an application; this type of testing should be done by testers. This doesn't mean that the programmers shouldn't check that their code works before releasing it (which of course applies to any stage of testing.)

Page 24: QTP Interview Questions

• system testing - black-box type testing that is based on overall requirements specifications; covers all combined parts of a system.• end-to-end testing - similar to system testing; the 'macro' end of the test scale; involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.

• sanity testing or smoke testing - typically an initial testing effort to determine if a new software version is performing well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5 minutes, bogging down systems to a crawl, or corrupting databases, the software may not be in a 'sane' enough condition to warrant further testing in its current state.

• regression testing - re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful for this type of testing.

• acceptance testing - final testing based on specifications of the end-user or customer, or based on use by end-users/customers over some limited period of time.

• load testing - testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system's response time degrades or fails.

• stress testing - term often used interchangeably with 'load' and 'performance' testing. Also used to describe such tests as system functional testing while under unusually heavy loads, heavy repetition of certain actions or inputs, input of large numerical values, large complex queries to a database system, etc.

• performance testing - term often used interchangeably with 'stress' and 'load' testing. Ideally 'performance' testing (and any other 'type' of testing) is defined in requirements documentation or QA or Test Plans.

• usability testing - testing for 'user-friendliness'. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and testers are usually not appropriate as usability testers.

• install/uninstall testing - testing of full, partial, or upgrade install/uninstall processes.

• recovery testing - testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.

Page 25: QTP Interview Questions

• security testing - testing how well the system protects against unauthorized internal or external access, willful damage, etc; may require sophisticated testing techniques.

• compatability testing - testing how well software performs in a particular hardware/software/operating system/network/etc. environment.

• exploratory testing - often taken to mean a creative, informal software test that is not based on formal test plans or test cases; testers may be learning the software as they test it.

• ad-hoc testing - similar to exploratory testing, but often taken to mean that the testers have significant understanding of the software before testing it.

• user acceptance testing - determining if software is satisfactory to an end-user or customer.

• comparison testing - comparing software weaknesses and strengths to competing products.

• alpha testing - testing of an application when development is nearing completion; minor design changes may still be made as a result of such testing. Typically done by end-users or others, not by programmers or testers.

• beta testing - testing when development and testing are essentially completed and final bugs and problems need to be found before final release. Typically done by end-users or others, not by programmers or testers.

• mutation testing - a method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation requires large computational resources.

104. What makes a good QA or Test manager?

A good QA, test, or QA/Test(combined) manager should:• be familiar with the software development process• be able to maintain enthusiasm of their team and promote a positive atmosphere, despite• what is a somewhat 'negative' process (e.g., looking for or preventing problems)• be able to promote teamwork to increase productivity• be able to promote cooperation between software, test, and QA engineers• have the diplomatic skills needed to promote improvements in QA processes• have the ability to withstand pressures and say 'no' to other managers when quality is insufficient or QA processes are not being adhered to

Page 26: QTP Interview Questions

• have people judgement skills for hiring and keeping skilled personnel

• be able to communicate with technical and non-technical people, engineers, managers, and customers.• be able to run meetings and keep them focused

105. What is 'configuration management'?

Configuration management covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools/compilers/libraries/patches, changes made to them, and who makes the changes. (See the 'Tools' section for web resources

with listings of configuration management tools.

106. What steps are needed to develop and run software tests?

The following are some of the steps to consider:• Obtain requirements, functional design, and internal design specifications and other necessary documents• Obtain budget and schedule requirements• Determine project-related personnel and their responsibilities, reporting requirements, required standards and processes (such as release processes, change processes, etc.)• Identify application's higher-risk aspects, set priorities, and determine scope and limitations of tests• Determine test approaches and methods - unit, integration, functional, system, load, usability tests, etc.• Determine test environment requirements (hardware, software, communications, etc.)• Determine testware requirements (record/playback tools, coverage analyzers, test tracking, problem/bug tracking, etc.)• Determine test input data requirements• Identify tasks, those responsible for tasks, and labor requirements• Set schedule estimates, timelines, milestones• Determine input equivalence classes, boundary value analyses, error classes• Prepare test plan document and have needed reviews/approvals• Write test cases• Have needed reviews/inspections/approvals of test cases• Prepare test environment and testware, obtain needed user manuals/reference documents/configuration guides/installation guides, set up test tracking processes, set up logging and archiving processes, set up or obtain test input data• Obtain and install software releases• Perform tests• Evaluate and report results• Track problems/bugs and fixes• Retest as needed• Maintain and update test plans, test cases, test environment, and testware through life cycle

107. What's the role of documentation in QA?

Page 27: QTP Interview Questions

Critical. (Note that documentation can be electronic, not necessarily paper.) QA practices should be documented such that they are repeatable. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented. There should ideally be a system for easily finding and obtaining documents and determining what documentation will have a particular piece of information. Change management for documentation should be used if possible

108. What if the application has functionality that wasn't in the requirements?

It may take serious effort to determine if an application has significant unexpected or hidden functionality, and it would indicate deeper problems in the software development process. If the functionality isn't necessary to the purpose of the application, it should be removed, as it may have unknown impacts or dependencies that were not taken into account by the designer or the customer. If not removed, design information will be needed to determine added testing needs or regression testing needs. Management should be made aware of any significant added risks as a result of the unexpected functionality. If the functionality only effects areas such as minor improvements in the user interface, for example, it may not be a significant risk.

109 How does a client/server environment affect testing?

Client/server applications can be quite complex due to the multiple dependencies among clients, data communications, hardware, and servers. Thus testing requirements can be extensive. When time is limited (as it usually is) the focus should be on integration and system testing. Additionally, load/stress/performance testing may be useful in determining client/server application limitations and capabilities. There are commercial tools to assist with such testing.

110. What can be done if requirements are changing continuously?

A common problem and a major headache.• Work with the project's stakeholders early on to understand how requirements might change so that alternate test plans and strategies can be worked out in advance, if possible.• It's helpful if the application's initial design allows for some adaptability so that later changes do not require redoing the application from scratch.• If the code is well-commented and well-documented this makes changes easier for the developers.• Use rapid prototyping whenever possible to help customers feel sure of their requirements and minimize changes.• The project's initial schedule should allow for some extra time commensurate with the possibility of changes.• Try to move new requirements to a 'Phase 2' version of an application, while using the original requirements for the 'Phase 1' version.• Negotiate to allow only easily-implemented new requirements into the project, while moving more difficult new requirements into future versions of the application.• Be sure that customers and management understand the scheduling impacts, inherent risks, and costs of significant requirements changes. Then let management or the customers (not the developers or testers) decide if the changes are warranted - after all, that's their job.• Balance the effort put into setting up automated testing with the expected effort required to re-do them to deal with changes.• Try to design some flexibility into automated test scripts.• Focus initial automated testing on application aspects that are most likely to remain unchanged.• Devote appropriate effort to risk analysis of changes to minimize regression testing needs.• Design some flexibility into test cases (this is not easily done; the best bet might be to minimize the detail in the test cases, or set up only higher-level generic-type test plans)• Focus less on detailed test plans and test cases and more on ad hoc testing (with an understanding of the added risk that this entails).

Page 28: QTP Interview Questions

111. How can it be known when to stop testing?

This can be difficult to determine. Many modern software applications are so complex, and run in such an interdependent environment, that complete testing can never be done. Common factors in deciding when to stop are:• Deadlines (release deadlines, testing deadlines, etc.)• Test cases completed with certain percentage passed• Test budget depleted• Coverage of code/functionality/requirements reaches a specified point• Bug rate falls below a certain level• Beta or alpha testing period ends

112. How many types of recording facility are available in QuickTest Professional (QTP)?

QTP provides three types of recording methods-

* Context Recording (Normal)

* Analog Recording

* Low Level Recording

113. How many types of Parameters are available in QuickTest Professional (QTP)?

QTP provides three types of Parameter-

* Method Argument

* Data Driven

* Dynamic

113. How to Start recording using QuickTest Professional (QTP)?

Choose Test > Record or click the Record button.

When the Record and Run Settings dialog box opens to do this;

1. In the Web tab, select Open the following browser when a record or run session begins.

2. In the Windows Applications tab, confirm that Record and run on these applications (opened

on session start) is selected, and that there are no applications listed.

114. How to do Laod testing for web based Application?

1. Recording a scenerio in QTP of my web based application.

2. Make 100 copies of that scenerio and run the test (scenerio run for 100 times)

3. In that case, do the load of application on server.

4. The basic logic of running the copy 100 times is to create same scenerio as if 100 users were

working.

115. How to supress warnings from the "Test results page"?

Page 29: QTP Interview Questions

From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

116. What's Checkpoints for QuickTest Professional (QTP)?

A checkpoint verifies that expected information is displayed in your application while the test is

running.

117. QuickTest Professional offers the following types of checkpoints:

Check Point Description Example of Use

Standard Checkpoint

Checks values of an object’s properties.

Check that a radio button is selected.

Image Checkpoint

Checks the property values of an image.

Check that the image source file is correct.

Table Checkpoint

Checks information in a table. Check that the value in a table cell is correct.

Page Checkpoint

Checks the characteristics of a Web page.

Check how long a Web page takes to load or if a Web page contains broken links.

Text / Text Area Checkpoint

Checks that a text string is displayed in the appropriate place in a Web page or application window.

Check whether the expected text string is displayed in the expected locatio

Bitmap Checkpoint

Checks an area of a Web page or application after capturing it as a bitmap

Check that a Web page (or any portion of it) is displayed as expected.

Database Checkpoint

Checks the contents of databases accessed by an application or Web site

Check that the value in a database query is correct.

Accessibility Checkpoint

Identifies areas of a Web site to check for Section 508 compliancy.

Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines.

XML Checkpoint Checks the data content of XML documents.

Note: XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page.

118. What's QuickTest Professional (QTP Window?

Before you begin creating tests, you should familiarize yourself with the main QuickTest window.

The QuickTest window contains the following key elements:

. Title bar—Displays the name of the currently open test.

. Menu bar—Displays menus of QuickTest commands.

. File toolbar—Contains buttons to assist you in managing your test.

. Testing toolbar—Contains buttons to assist you in the testing process.

. Debug toolbar—Contains buttons to assist you in debugging tests.

. Test pane—Contains the Keyword View and Expert View tabs.

. Active Screen—Provides a snapshot of your application as it appeared when you performed a

certain step during the recording session.

Page 30: QTP Interview Questions

. Data Table—Assists you in parameterizing your test.

. Debug Viewer pane—Assists you in debugging your test. The Debug Viewer pane contains the

Watch Expressions, Variables, and Command tabs. (The Debug Viewer pane is not displayed

when you open QuickTest for the first time. You can display the Debug Viewer by choosing View

< Debug Viewer.)

. Status bar—Displays the status of the QuickTest application

119. How to proceed with QTP when QTP doesnt idenify the object? When a object is not being

recognised by QTP, what is the work around so that you can continue with automation? 

Try to identify why object is not getting recognized. Like some of the properties used to identify

the object may change dynamically. Try using regular expression or try to supply the value from

the datatable2. As suggested earlier ... Try using ordinal ...

120. What is the advantage of using shared object repository in QTP? 

Advantages of Share Repositry:1) Re-usablility : Same Repositry can be used with any number of

Actions/Test Scripts2) Easy to maintain and update : If yuo are using Share repositry and any one

of the Object Property in your application ...

121.When ordinal identifiers alone can make an object unique then why they are not given top

priority? Why it is first mandatory and next assitive. Why we cannot go for ordinal identifiers

directly? 

It will consume more time that 's the reason. ...

122.By default, how many number of tables would be there in a script?

a) Oneb) Twoc) Threed) Four ?

If you mean datatable, by default it will be just one.This one data table will contain the global

sheet and one sheet for each action in the script. ...

123.Identify the recording mode, by which you can record the non-standard object in QTP

A) Standard recordingB) Analog recordingC) Low level recordingD) None ?

If QTP does not recognize an object it is called as non-standard object in QTP, that is those

objects are not present in the object repository of the QTP, in this case we generally go for the

low level recording. ...

124.How will you update script for changed functionality? 

Page 31: QTP Interview Questions

If the functionality changes you will anyways have to write the new script... If the properties

change yes you can update them to OR.what does changed functionality mean anyway ...

125.What are the prerequisites to connect QTP with QC? 

1. You need to install the QC add-in for QTP. Go to the QC add-in page (the More HP QC Add-

ins page) and select and install the QTP add-in. If you do not do this you can not connect QC and

QTPAlso you require this add-in to run QTP test from QC directly2. ...

126.What is the difference between 'Recovery Scenario' and 'On Error Resume Next'? 

Recovery Scenario: When Unexpected events, errors, and application crashes during a run

session can disrupt your run session and distort results.

On error Resume Next: When you want to flip the error control switch to the off position. ...

127. What is the significance of regular expression in QTP? 

Also Regular Exp is used for pattern matching and replacing of a string.* : Matches the preceding

character zero or more times.. : Matches any single character except a newline character. ...

128.What are the limitations of QTP encountered while Automating Share Point application? 

Few limitations of QTP :

1.Not advisable for unstable systems.

2.Does not support Ad-hoc testing.

3.Does not support validation testing.

4.Cannot be used to compare pdf and word files. ...

129. Image Validation is not supported by which automation tool

a) QTP b) Winrunner c) Both of the above ?

Page 32: QTP Interview Questions

QTP Supports Image validation.But image checkpoint checks only for image properties ( image

file name, image size..etc.).We can use bitmape check poit to compare the image pixel by

pixel. ...

130.What is Hybrid Framework and how it is useful? How will you implement hybrid framework in

a project? 

Test automation framework is a set of assumptions, concepts and practices that provide support

for automating your scripts the Hybrid Test Automation Framework incorporates features of Script

modularity, Functional Decomposition and Data Driven framework. ...

131.How do we decide as to which recording mode from Context Recording (Normal), Analog

Recording or Low Level Recording do we select for an application? What is uniqueness in each

recording mode? 

1) Normal recording is also known as context sensitive recording. This is the default recording mode in QTP which is used to record the operations on standard GUI objects. For each and every operation it generates (statement) script.

2) In analog recording we will record mouse and keyboard operations with respect to window or desktop co-ordinates. Here it generates single statement for all operations.

Note:

a) If you take desktop coordinates u may get wrong output if the application is moved from one place to another.

b) If you take window coordinates you will get the correct output even the application is moved from one place to another.

3) Low level recording is used to record the operations on the objects which are not recognised by the QTP.

Recording Type Function Keys from Keyboard Normal Recording - F3

Page 33: QTP Interview Questions

Analog - CTRL + SHIFT + F4Low Level - CTRL + SHIFT + F3

132.When do you use analog recording to record a test? 

Enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. In this recording mode, QuickTest records and tracks every movement of the mouse as you drag the mouse around a screen or window.

This mode is useful for recording operations that cannot be recorded at the level of an object, for example, recording a signature produced by dragging the mouse.

Note: You cannot edit Analog Recording steps from within QuickTest

133.How to copy a datatable content from globalsheet to localsheet (action1)? 

At runtime you can coopy the data from Global sheet to Loca Sheet(Action1) in following

sequence:-

1) Export the data of Global sheet to some temporary excel (for eg C:Test1.xls)

DataTable.ExportSheet("C:Test1.xls","Global")

2) Import the data of this temp excel to Action1 datatable as

DataTable.ImportSheet("C:Test1.xls","Global","Action1")

This code is not tested,  but it should work this way.

134.For what purpose step generator is used? 

The Step Generator enables you to add steps quickly and easily by selecting from a range of context -sensitive options amd entering the required values. In the Step Generator dialog box you can define that use* Test Object and Properties* Utility Object methods and properties* Calls to library functions VBScript functions and internal script functions.

For Ex: You can add a step that checks that an object exists or that stores the returned value of a

Page 34: QTP Interview Questions

method as an output value or as part of a conditional statement. You can parameterize any of the values in your step. 135.How to parametrize through environment. Please use a suitable example? 

Just a add on...You can also put all common variables  in an external xml file  and import  it  into 

the  QTP  to be used  across all  tests.The structure  of  XML  file would be: ...

136.How to make QTP understand the difference with same type of objects

Use the Ordinal identifiers (index) property...each of the objects will have a different index value

QTP identifies the object in following manner-

1) First with mandatory and assistive property. If these are not sufficient then "Ordinal Identifier"

2) By using "Smart Identification".

In your case you have different object of same type. First they have different names so object will be identified easily.

If there are more than one object with the same name than use "Ordinal Identifier - Index".

With "Index" property object will be identified.

We can use the descriptive programming for identifying the 6th checkbox from a bunch of checkboxes on a page.

Dim obj_ChkDesc

Set obj_ChkDesc Description.Createobj_ChkDesc(“html tag”).value “INPUT”obj_ChkDesc(“type”).value “checkbox”

Dim allCheckboxes

Set allCheckboxes Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc)

allCheckboxes(5).Set “ON”

As index value start from the value '0' so 6th object is having index value '5'

 

 137. Where do checkpoints get stored?

Page 35: QTP Interview Questions

Object Repository

If the question is about checkpoint properties then the answer is Action#resouce.mtr files

If the question is about after executing the checkpoint then the answer is Action#ResultFolder.

Check Points are stored in ObjectRepository.bdb under the action(X) folder.138. What is the function of ADD Ins in QTP?

QTP Add-in is to identify the object-type in the AUT(Application under test).

By default QTP supports 3 add-ins

a. Visual Basic

b. Web

c. Active-X

If you de-select web add-in and then record a test. Then obeject identifiers will fail to recognise

web-objects.

Other supported Add-in's are:

Java

Siebel

.NET

TE(Terminal Emulator)

may more......

139. How will you analyse results in QTP?

Expand the Tree format of Test Result window and check all the below

After you run a test the Test Results window displays all aspects of the run session including:

1.a high-level results overview report (pass/fail status)

2.the data used in all runs

3.an expandable tree of the steps specifying exactly where application failures occurred

4.the exact locations in the test where failures occurred

5.a still image of the state of your application at a particular step

6.a movie clip of the state of your application at a particular step or of the entire test

7.detailed explanations of each step and checkpoint pass or failure at each stage of the test

140. What is the difference between DIM and SET? When to use DIM and when to use SET?

Page 36: QTP Interview Questions

Dim can be used to store a value in a variable. For example: Dim a a 10

Set can be used to store a object or child object from AUT

eg. set a Browser(" ").Page(" ").childobject(obj) obj is already described through descriptive programming & by using above script we can store child objects in a web page like webbutton webradio button web list link etc.

141. How to write and where we call user defined functions in QTP? Give an example?

Using QuickTest you can define and store your user-defined functions either in a function library (saved as a .qfl file by default) or directly in an action within a test. A function library is a Visual Basic script containing VBscript functions subroutines modules and so forth. You can also use QuickTest to modify and debug any existing function libraries (such as .vbs or .txt files).

When you store a function in a function library and associate the function library with a test the test can call the public functions in that function library. Functions that are stored in an associated function library can be accessed from the Step Generator (for tests and function libraries) and the Operation column in the Keyword View as well as being entered manually in the Expert View.

When you store a function in a test action it can be called only from within that action—the function cannot be called from any other action or test. This is useful if you do not want the function to be available outside of a specific action.

You can also define private functions and store them in a function library. Private functions are functions that can be called only by other functions within the same function library. This is useful if you to reuse segments of code in your public functions.

We can write user define functions in QTP Editor or in notepad also. when we write funtions in notepad we have to save file with .vbs extention. and close notepad then we can use that file in qtp resources. in resources we give notepad file path. than we can use funtion directly by functions name.... 

142.How to use Regular Expression

i am opening the google page with scripting and now using regular expression i want to enter browser and page name of google to enter the search text and search.?

browser("title: .*Google.*").Page("title: .*Google.*").webedit("Search").set "Test Search" browser("title: .*Google.*").Page("title: .*Google.*").webbutton("Search").click

This is not something which will directly work by copy paste but just to give you an idea of the concept.

143. Which is the Default Identifier: Index, Location, Creation Time?

For windows applications we can select index or location For web applications we can select loading time

Page 37: QTP Interview Questions

 

144.parametrization using file

How do we input values from file ?

Generally QTP exports uses Excel file for data paramaterization. 1)Prepare test data in Excel sheet and import into QTP data table. Using DataTable methods user can easily parameterize data and access them through out the script.DaTaTable Methods: Import ImportSheet Export ExportSheet GetSheet SetCurrentRow SetNextRow etc...

E.g:

DataTable.Import "Excel file path"testData DataTable(columnName Sheetname)(or)testData DataTable(columnName dtGlobalSheet)

2)Prepare test data in Excel sheet. Instead of importing Excel file/sheet into Test script create an Excel object in the script using CreateObject method. Using Excel object methods user can able access data from excel sheet.

E.g:Set ExcelObj CreateObject("Excel.Application")ExcelObj.WorkBooks.Open "Excel file path" false false Set currentWorkSheet ExcelObj.ActiveWorkBook.WorkSheets(1) 'first sheettestData currentWorkSheet.Cells(rownumber columnnumber).Value ExcelObj.Application.Quit

145. How to capture and display text check point value in message box without using o/p checkpoint?

Store display text in object repository and use the following code to read text

Msgbox Brpwser("Browser").page("Page_Name").webelement("text").GetROProperty("innertext")

where "innertext" is property of the display text.

146. How do we count links on the web page displayed?

Set LinkDesc Description.Create ()

LinkDesc( micclass ).value Link

LinkDesc( html tag ).value A

set Links Browser( QTP - Google Search ).Page( QTP - Google Search ).ChildObjects(LinkDesc)

Page 38: QTP Interview Questions

Msgbox Links.Count

147. How to delete 10 first mails by using qtp?

Browser("Yahoo!").Page("Yahoo!").Link("Mail").Click Browser("Yahoo!").Page("Yahoo! Mail: The best").WebEdit ("login").Set "venkatraj.banka"

Browser("Yahoo!").Page("Yahoo! Mail: The best").WebEdit ("password").SetSecure "password" Browser("Yahoo!").Page("Yahoo! Mail: The best").WebButton ("Sign In").Click Browser("Yahoo!").Page("(10 unread) Yahoo! Mail").Link ("Inbox (10)").Click

For i 1 to 10

b Browser("Yahoo!").Page("Inbox (10) - Yahoo! Mail").webtable("inbox(10)").ChildItem (i 1 "WebCheckBox" 0).Set "ON" Next b.Delete

148. What is difference between client/sever , web server application in Testing Point of view ??

1.Client server applications have a controlled client. web applications are client server applications. The browser is a client and the webserver is a server 2. Client server application is loaded at the server and in every client machine an exe is loaded to call the application. 3.Client server systems works within a company's intranet & may be obscure enough that none tries to hack it or even cares to.

1.Web applications: these are tested with many different client versions and configurations.2. Applicationm is loaded at the server but no exe is installed at the client machine we have to call the application through browser.3.Web applications are exposed to the open internet.

149. How to call QTP from Quality Central? In General Users upload test scripts into Test Plan module in QC.

open the script in QTP through QC

1)Goto Test Plan

2) Click on the test script you want to review Test script will be opened in Right pane of the screen

3) There you can find QTP Tool symbol. Click on it... Automatically QTP opens along with that script

If you want to execute test script from QC

1) Goto test lab create testset

2) Add test script into it and Click on Run button and test script will be executed from QC

150. What is the difference between New and Open bug? Who is responsible for changing the phase of bug from New to Open?

Page 39: QTP Interview Questions

When a tester found a bug in a software during testing and the bug is verified by the T.L. then it is called the " New"state of a bug. When the Testing Lead sent the bug to Development Lead for modification and it is verified by the D.L. it is called the "Assigned" state of a bug. The bug is then transferred to development team to fix it. The developer open the bug it is called the "Open" state of a bug. 151. What more status can you give to a test case other than pass, fail, not run & blocked?

after finding the bug..first we have to give NEW status.. then after QA consolidation..he will alot OPEn status he will assign to corresponding developer after fixation of the bug he will give the statusa VERIFIED after finilizing the bug developer send to testing team if the bug is really geniun w e have to give the status CLOSE if not properly rectify..then we should give the status REOPEN......

152. If i miss a important bug and i realise it very late then what will i do?

when your approach towards the testing task is really systematic there is no question of missing important bug araises. still i would prefer to answer your question.

If you really come to know that you have missed an important bug while reporting them Then you should react according to your cadre i.e. if you are a team member of a testing team then you should report the same to your Team Leader and he should take the necessary action for reporting that bug.

OR if your work environment permits you to report it to the concerned person then you should Log that bug and should check forthe same in the relevant build 

 

 

 

Page 41: QTP Interview Questions

 

 

 

 

 

 

 

 

 

 

 

Page 42: QTP Interview Questions