Friday, April 26, 2013

SAP ECC Configurations

SAP ECC Configurations for QTP & SAP TAO


              SAP Server Side Configurations

              To perform this go to T-Code:- RZ11



             Enter name of profile parameter as “sapgui/user_scripting”.Click display button.


             If like above the current value is set to FALSE then convert it to TRUE.




             Save the changes. NOTE : Write TRUE in CAPS.


SAP Client Side Settings


             Enabling user scripting at client end


              Check the box "enable scripting".If it is not checked.


               You get this option during installation of SAP GUI as shown below:

SAP TAO

SAP Test Acceleration & Optimization (TAO):

SAP Test Acceleration & Optimization (TAO) is the latest technology for test automation on SAP systems. Having come a long way since version 1.0, SAP TAO version 2.0 and above includes the latest innovations in test automation to reduce the development time of automated scripts and lower the maintenance costs traditionally associated with test.

Based on the Business Process Testing (BPT) framework, SAP TAO has a number of modules which not only increase the speed of automated test creation on SAP technology through an intuitive interface but also reduce the maintenance by reading the SAP transports for information related to application change.

With the Process Flow Analyzer (PFA), which detects user interactions, it’s possible to generate Business Process Testing scripts faster than ever with data tables generated on the fly. Once the scripts have been developed with the PFA, they can be executed on demand.


Traditional test automation suffers from high maintenance as scripts become unstable once an application changes making agile developments difficult to support.

In SAP TAO 2.0 and above any changes within the SAP transport mechanism can be detected using the Business Process Change Analyzer (BPCA). The BPCA find areas of the application which have changed in a transport and creates a report showing which automated test cases are affected by the change allowing proper change impact analysis.

Furthermore the BPCA also supports technical updates of the automated scripts on the fly drastically reducing maintenance and differentiating itself from other solutions in the market.

HP QuickTest Professional (HP QTP):
HP QuickTest Professional (QTP) is an automated software testing suite designed for testing various software applications and environments. It performs functional and regression testing through a user interface such as a native GUI or web interface.

QTP It works by identifying the objects in the application user interface or a web page and performing desired operations (such as mouse clicks or keyboard events); it can also capture object properties like name or handler ID.

A VBScript scripting language is used by QTP to specify the test procedure and to manipulate the objects and controls of the application under test. To perform more sophisticated actions, users may need to manipulate the underlying VBScript.

HP Quality Center(HP QC):
HP Quality Center software is a scalable, centralized platform for managing and automating the delivery of secure, stable, high quality applications. HP Quality Center software enables you to implement a complete quality management infrastructure, establish consistent, repeatable processes and best practices for managing requirements, tests, and business components.

Pre-requisites for General Automation

This article was written by Rohini R:

Automation testing is the most preferred way to achieve our testing goals on time. But it is in turn has lots of dependencies on other parameters. We will see below some of them.
Why Test Automation?
Below are some reasons on why to go for automation:

  • New releases and bug fixes in working module
So automate your testing procedure when you have lot of regression work.
  • Testing web applications with multiple users simultaneously
Automate your load testing work for creating virtual users to check load capacity of your  application.
  • Testing application where code is changing frequently
Automate your testing work when your GUI is almost frozen but you have lot of frequently functional changes.
Risks associated with Automation:
There are lots of risks associated with test automation. We need to give importance to each one of the below to reap the benefits out of automation.
  • Skilled resources:
For automation you need to have resources having some programming knowledge.
“Do resources have sufficient programming knowledge for automation testing? “
If not, do they have technical capabilities or programming background that they can easily adapt to the new technologies?
  • Initial cost for Automation is very high:
Automation cost is too high for initial setup i.e. cost associated to automation tool purchase, training & maintenance of test scripts are very high.
  • Do not think to automate your UI if it is not fixed:
Beware before automating user interface. If user interface is changing extensively, cost associated with     script maintenance will be very high. Basic UI automation is sufficient in such cases.
  • Is your application stable enough to automate?
It would be bad idea to automate testing work in early development cycle (unless it is agile environment). Script maintenance cost will be very high in such cases.
  • Are you thinking of 100% automation?
You cannot 100% automate your testing work. Certainly you have areas like performance testing, regression testing, load/stress testing where you can have chance of reaching near to 100% automation. Areas like User interface, documentation, installation, compatibility and recovery where testing must be done manually.
  • Do not automate tests that run once:
Identify application areas and test cases that might be running once and not included in regression.
  • Will your automation suite be having long lifetime?
Every automation script suite should have enough life time that its building cost should be definitely less than that of manual execution cost.

This is bit difficult to analyze the effective cost of each automation script suite. Approximately your automation suite should be used or run at least 15 to 20 times for separate builds (General assumption. depends on specific application complexity) to have good ROI.
Conclusion:
Automation testing is the best way to accomplish most of the testing goals and effective use of resources and time. But you should be cautious before choosing the automation tool.

Be sure to have skilled staff before deciding to automate your testing work. Otherwise your tool will remain on the shelf giving you no ROI. Handing over the expensive automation tools to unskilled staff will lead to frustration.

Before purchasing the automation tools make sure that tool is a best fit to your requirements. You cannot have the tool that will 100% match with your requirements. So find out the limitations of the tool that is best match with your requirements and then use manual testing techniques to overcome those testing tool limitations. Open source tool is also a good option to start with automation.

Monday, April 15, 2013

QTP interview Questions

QTP Interview Questions and Answers

QTP Basic Features

1. What are the advantages in Test Automation?

a) Fast: Test Tool runs tests significantly faster than human users.

b) Reliable: Automation tool can perform the same operation each time, if we repeated multiple times, so that we can eliminate human errors.

c) Repeatable: We can check how application or website reacts after repeated the same operation with multiple times.

d) Reusable: Automation scripts are reusable on different version of the application of websites even if the user interfaces changes.

e) Comprehensive: In automation testing we can build a suit of tests that covers every feature in the application or website.

f) Programmable: We can program sophisticated Tests that bring out hidden information from the application

2. What are the drawbacks in Test Automation?

a) It is expensive

b) We cannot automate all areas.

c) Lack of Skill

d) It has some limitations (It cannot test every thing)

3. What type of test tools available in the industry?

We can segregate Test tools in 2 categories

a) Business Classification

1) Vendor Tools

2) Open Source Tools

3) In-house Tools

b) Technical Classification

1) Functional and Regression Test Tools

2) Load/Stress/Performance Test Tools

3) Security Test Tools

5) Test Management Tools

6) Unit Test Tools

7) Requirement Management Tools Etc...

4. What are the important factors in test tool selection?

a. Technical factors:

i. Nature of the AUT (Application Under Test)

ii. Tool Features (Facilities available)

iii. Availability of Skilled professionals

iv. Organizations experience

v. Technical support from vendor

b. Business factors:

i. Budget

ii. Vendor’s Reputation

iii. Client’s Interest

5. What test cases can be automated?

Test cases that we want to execute on number of versions of the software

Ex: Regression test cases

Test cases that we want to execute with multiple sets of data

Ex: Data driven test cases

Test cases having complex functionality

6. What test cases cannot be automated?

Dynamically changing functionality

Test cases that require more Human interaction CUI (command user interface) based test cases

7. Explain about the Testing process in QTP?

Planning:



1. Analyzing the Application

2. Automation Framework Implementation

3. Selecting/Generating Test cases for Automation

4. Collecting Test Data

5. Configuring Tool Settings

6. Generating the basic tests

Using Object Repository method or using Descriptive Programming, we can generate Tests

Enhancing Tests

With respect to our project requirements, we have to enhance our tests. For enhancing tests QTP is providing various features like:

Inserting Transaction points

1. Synchronization

2. Parameterization

3. Inserting VB script Flow Control statements

4. Adding comments

5. Calling Functions/ calling Actions

6. Using Environment variables

7. Entering Regular Expressions

8. Inserting Checkpoints

9. Inserting Output values

Etc..

Note: For any Test all enhancement methods not required.

Debugging Tests (if required)

1. It is optional; basically scripting languages are Light weight languages, no need to compile them separately. During execution Scripts can be compiled and Run.

2. If we have any doubts about some scripts, then we can execute them step by step with the support of VBScript Debug commands and Break points

Running tests

1. Generally, many companies are using Framework feature for Running Tests.

2. QTP Supports Individual Test execution, Batch execution, Tests execution through AOM Scripting, and Scheduled execution with the support of Windows Operating system.

Analyzing Results

1. It is not the Responsibility of QTP; Test engineer has to do this manually.

2. QTP is providing Result window in XML format.

3. QTP is providing Result deletion tool also.

4. QTP is providing Test results exporting facility. It supports HTML, Word document and PDF (portable document format) formats.

Reporting defects

Reporting defects also not a QTP responsibility that we have to do manually after analyzing the results, but if we are using Quality Center, from QTP result window we can send defects directly.

8. What types of License available for QTP?

a) Seat License or Node locked

Fixed for one System (Machine), we can use from that System only

b) Concurrent License or Floating License

This License, we can use from different Systems but one at a time

9. What are the QTP supported environments?

QTP Supports Software Applications based on Add-ins only

Add-in means Technology supporting files

QTP Add ins available for following technologies:

a) Default Add ins

1) Activex

2) Visual Basic

3) Web

b) Other Add-ins

1) Delphi

2) Java

3) .NET Web forms

4) .NET Windows forms

5) WPF (Windows Presentation Foundation)

6) Oracle

7) People Soft

8) Power Builder

9) SAP for Web

10) SAP GUI for windows environment

11) Siebel Environment

12) Standard Windows

13) Terminal Emulator (TE)

14) Visual Age Smalltalk Environment

15) Web Services Environment

10. Does QTP Support UNIX Environment?

No, QTP doesn’t support UNIX/Linux Environment, Supports Windows Operating Environment only, but LoadRunner and Quality Center have support both Windows and UNIX Operating Environments.

11. What is the scripting language that used in QTP for applying programming logic?

Micro Soft Visual Basic Scripting edition (VBScript) engine embedded with QTP.

12. Does QTP Support Database Testing and Data driven Testing?

Yes, SQL Engine embedded with QTP Tool, so we use SQL Statements directly in QTP Test Pane as well as in Function Library.

QTP has an integrated Spread sheet(Excel like) for Performing Data Driven Testing, otherwise we can fetch test data directly from external files and databases using VB Script.

Creating Tests (Recording & Running, Object Repository and Object Identification Configuration)

13. What is Recording in QTP?

It is process of creating the main body of a test by recording the typical processes that users perform.

QuickTest records the operations we perform, displays them as steps in the Keyword View, and generates them in a script (in the Expert View).

14. How many Recording Modes available in QTP? What are they?

There are 3 Recording modes available in QTP.

1) Normal Recording

2) Analog Recording

3) Low Level Recording

15. What is Analog Recording modes

It Records exact mouse and keyboard operations, we can use this mode for recording continues mouse operations like digital signatures, paints etc..

This mode doesn't generate statements for each and every operation, generates all operations in a Track file.

By default this mode is disabled, after selecting Normal Recording mode only it enables.

16. What is Low Level Recording?

It Records some operations on Non-supported environments apart from Normal operations.

17. What are object and Software Objects?

Object: Object is something, which has structure and properties.

Software Object: an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure.

Example:

GUI (Windows) Environment: Window, Dialog box, Edit Box, Button, Check Box, Radio Button, List Box and Combo Box etc...

Web Environment: Browser, Page, Link, Image, edit Box, Button, Grid, Frame Etc..

18. What type of Objects available in QTP?

There are 4 types of Objects available in QTP.

1) Run-time Objects

2) Test Objects

3) Utility Objects

4) Automation / User Defined Objects

19. What are Utility Objects?

These are QTP reserved objects, used for Testing and Result reporting.

Example

a) SystemUtil

b) Reporter

c) DataTable

d) Services

e) environment etc...

20. What is Automation Object?

An object that is exposed to other applications or programming tools through Automation interfaces.

21. Explain about Object, Property and value?

Object: It is something which has structure and properties

Property: an attribute of an Object.

Value: Value of the Property

22. What is Object Repository?

It is a Storage place for Storing Objects, QTP has 2 types of Repositories.

a) Local Repository

b) Shared Repository

23. What are the differences between Local and Shared Repositories?

Local Repository:

QTP Creates a Local Repository for every Action during Recording automatically and also QTP maintenance Local Repositories, but user can edit these repositories.

It is a QTP Internal file, extension is .mtr

Shared Repository:

User Creates Shared Repositories by adding objects in Object Repository Manager.This can be shared among nuber of tests.

User has to maintain shared repository files

Shared Repository files are External files, extension is .tsr

24. How to Start Test Automation Process, before the Application is ready?

QTP is providing a feature called "Define New Test Object" for creating new objects without Application. This feature available in Local Repository and Object Repository Manager.

25. How to Combine Repositories?

We Can combine Repositories using Object Repository Merge Tool. It is available in Object Repository Manager

26. Explain about Statement, Action and Test in QTP?

a) Statement: an Instruction or a minimal executable unit

b) Action: Set of Statements

c) Test: One or more Actions

Design Time Data Table:

1. It is viewed in the QTP Main Test

2. It is created prior to the test execution

3. It represents data from external Sources

Run-Time Data Table:

1. It is viewed in the QTP Test Result Window

2. It is created in Test Results after test execution.

3. It represents a live version of design Time Data table.

27. What are the differences between Actions and Functions and which are better?

Actions:

1. It’s a QTP feature and Local feature (not a global feature)

2. We can use check points in Actions

3. As it is QTP feature it may corrupt

4. Actions are slow execution

Functions:

1. It’s a VB script feature and global concept

2. We can’t use checkpoints in functions, instead of checkpoints we can use validation points (Loops and Conditional statements)

3. It doesn’t corrupt

4. Functions are faster in execution than Actions

28. How create methods in QTP?

By associating procedures to test objects.

29. How to enhance tests with windows API functions?

With the help of WSH (It is a Windows administration tool), we can use Windows API functions for enhancing Tests.

30. What are the major differences between functions and actions in QTP? What advantages there in functions than actions?

Read 21st question and answer.

31. What is Automation Object Model?

It’s a process of Automating the Quick test operations. To do this we can use java script, VC++ and .NET Apart from VBscript.

32. What is Windows Script Host?

WSH is a windows administration tool, it provides hosting environment for running VBscript, Jscript scripts.

33. What is exception handling?

Handling expected and unexpected errors during execution

34. What is the difference between constants and variables in VB Script?

We use constants for replacing literal values and constants never change.

We use variables for storing values that returned by the program, functions, etc.

Variable values may vary through out the script.

35. How test engineer identifies when programmatic descriptions are useful?

If application is not ready (using screenshots and documents we can prepare descriptive programming)

If we want to make our scripts global

If lengthy tests are there and that we want to execute fast

36. How to retrieve data from application objects?

Using loop statements and GetROProperty method

37. How to build scripts that access data from external resources?

We can fetch test data directly from external files and databases by creating automation objects

Ex:ADODB, Filesystem object

38. What is object spy used for?

It is a feature of QTP, used for getting the object’s information (all properties and values) .It is available in QTP tool main window, in Local repository and in object Repository Manager

39. What is the purpose of input parameters?

For Passing values

40. What is an Action? How many types of Actions are there in QTP?

Set of statements to perform a task or tasks is called an Action.

Three types of actions are there.

1. non reusable actions

2. reusable actions

3. External actions

In QTP 9.2 default action is: Non reusable

form QTP 10.0 default action is: Reusable

Example:

Let there are two tests : test:1 and test:2

In test:1 let there are two actions

a.login (reusable)and b. insert order(nonreusable)

in test:2 let there are two actions

a.open order(reusable) and b. fax order(non reusable)

If we call login action from test:1 in test :2 then login action is called External action.

In test :2 login is reusable but calling point of view its external action

41. What is a virtual object? How to configure virtual objects?

Whenever QTP is not recognizing an area or user defined object as an object that we can make as a virtual object.

For making virtual objects QTP is providing a feature called Virtual object manager. Through this we can configure virtual objects.

42. What are dynamic objects?

The object, which properties change dynamically (frequently). We can use Regular Expressions to handle dynamic objects.

43. What is the purpose of description object?

The purpose of description object is to store multiple properties values of a test object.

44. What is the advantage of associating a procedure to a test object?

By associating a procedure to a test object we can use this as a method on that test object.

45. How to create a Library File?

Open an Editor (Ex: Notepad),

Generate some script statements and save with .vbs extension.

In a library file we can put more than one function also

46. What are the disadvantages of using actions?

Action is a QTP tool feature that occupies QTP’s more memory space.

It may be corrupted.

It is not a global feature. Test engineer may not have the control on action.

47. What is the difference between Test Objects and Run Time Objects ?

Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to which a test object maps.

48. Can i change properties of a test object?

Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch off the Smart Identification for the

object on which you use SetTOProperty function.

Can i change properties of a run time object?

No (but Yes also). You can use GetROProperty("outerText") to get the outerText of a object but there is no function like SetROProperty to change this property. But you can use WebElement().object.outerText="Something" to change the property.

49. When and Why to use Descriptive programming?

Below are some of the situations when Descriptive Programming can be considered useful:

The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout <>”.

When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object.

When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository

Scenario 1: Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing

Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page.

Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well.

When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach.

50. How to use Descriptive programming?

There are two ways in which descriptive programming can be used:

a) Static Programming: By giving the description in form of the string arguments.

b) dynamic Programming: By creating properties collection object for the description.

51. What are the extensions of QTP files?

1. QTP Test / Test Script(.mts){.mts=module/mercury test script}

2. Local Repository file (.mtr){.mtr=module/mercury test repository}

3. Shared repository files(.tsr){Test shared repository}

4. Library files (.vbs)

5. Environmental files (.xml)

6. Test batch file (.mtb){module test batch}

7. QTP result file (xml) optional: pdf, doc, xml-for reporting

8. Recovery scenario file (.qrs){quick recovery scenario}

52. How to handle dynamic objects?

By using Regular expressions we can handle dynamic objects.

54. What are the differences between checkpoint and output value?

Both are same in insertion but different in purpose.

Checkpoint is a verification point, it takes expected results from the user and compare with the actual results during execution and provides test results.

Output value captures object properties values, database content and xml elements values and stores in run time data table.

Checkpoints compare actual results with expected results, output values captures values and stores.

55. How to handle Repositories dynamically?

With Repositoriescollection utility object, we can handle shared object repositories dynamically.

Note: on Repositoriescollection object, we can use Add, Find, Remove, and Removeall like methods.

56. What is the use of environment variables?

Environment variables are global variables that we can use from number of tests commonly.

Whenever we want to use some variables from number of tests, instead of declaring as local variables, if we use environment variables concept then maintenance will be easy.

57. What is a Regular Expression, where we use this feature in QTP?

Regular expression is nothing but matching patterns.

In QTP, we use this feature for identifying dynamic objects

58. What is the advantage of Dynamic Descriptive Programming than Static?

Incase of dynamic programming Tests generation is easy and maintenance also very easy.

59. What are the limitations of QuickTest?

a. It supports MS Windows operating environment only

b. It doesn’t support CLI Applications (Command line interface)

c. It supports IE only for generating scripts but it does not support Mozilla and other browsers. For executing tests it supports Mozilla like other browsers.

d. It has limited support for web services testing.

60. How to capture a moving image in QTP?

61. What is Smart Identification in QTP and explain it?

62. How many folders are created in one Test creation in QTP?

Two folders and six files.

63. What is Description object in QTP?

64. What are the Properties you use for identifying a Browser, a Page when using descriptive programming?

title property for Browser

title property for Page

65. How do you measure Transaction Time in QTP other than Using of Start and End Transaction Points?

By using ‘Timer’ function we can measure transaction times.

66. what is the Deference between Recovery Scenario and "On Error Resume Next"?

1) Both are for handling Error events, Recovery Scenario is a QTP Tool feature, whereas "On Error Resume Next" is a VB Script feature

2) "On Error Resume Next" is used when we are sure about the step where the error can occur. Recovery Scenario can be used to handle unexpected event or error.

********************************************************

On Error Statement (Visual Basic)

1. Enables an error-handling routine and specifies the location of the routine within a procedure; can also be used to disable an error-handling routine.

2. Without an On Error statement, any run-time error that occurs is fatal: an error message is displayed, and execution stops.

3. Whenever possible, we suggest you use structured exception handling in your code, rather than resorting to unstructured exception handling and the On Error statement.

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

QTP Automation Object model deals with Automation of QTP itself. Almost all configuration and functionality provided by QTP is represented by QTP's Automation Object Model . Almost all dialog boxes in QTP have a corresponding automation object which can set or retrieved using the corresponding properties or methods in the Automation Object Model.QTP Automation Objects can be used along with standard VB programming elements like iterative loops or conditional statements to help you design a script of choice

68. What is Test Fusion Report ?

Test Fusion Report , displays all aspects of a test run and is organized in a Tree format.

It gives details of each step executed for all iterations.

It also gives Run-time data table, Screen shots and movie of the test run if opted.

69. How can you handle exceptions in QTP?

In QTP Exceptional handling is done by using

a. Recovery Scenarios.

b. Using “On Error” statement

In Recovery scenario you have to define.

1. Triggered Events.

2. Recovery steps.

3. Post Recovery Test-Run.

At Script Level you can use the On Error Resume Next and On Error Go to 0 statement.

70. What is the Difference between Bitmap Check point & Image Check point?

Bitmap checkpoint does a pixel to pixel comparison of an image or part of an image.

Image checkpoint does do a pixel to pixel comparison but instead compare imageproperties like alt text , destination url etc.

71. How would you export a Script from one PC to another in QTP ?

We can make use of the "Generate Script" function available in Object Identification, Test Settings and Tools/Options tab to create a zip of the script at the source computer. These zip files then can be imported into QTP at the destination computer.

72. Can launch two instances of QTP on the same machine ?

No. You can work with only single instance of QTP on the same machine. But QTP itself can work on multiple instances of the Application Under Test (AUT). Ex: QTP can handlemultiple IE browser windows.

73. What is SetToProperty ?

SetToProperty changes property of an object stored in the Object Repository. However these changes are not permanent.

74. What is Accessibility Checkpoint?

World Wide Web Consortium (W3C) came up with some instructions and guidelines for Web-based technology and information systems to make it easy for the disabled to access the web. For example the standards make it mandatory to have an 'alt text' for an image. So a blind person who is accessing the website, will use text - to -speech converters and atleast understand what the image is about if not see it. All these standards are checked by Accessibility Checkpoints.

75. What is the difference between Properties and methods?

A property is a named attribute of an object. Properties define the characteristics of an object such as Size, Color etc. or sometimes the way in which it behaves.

A method is an action that can be performed on objects.

For example, a dog is an object. Its properties might include long white hair, blue eyes, 3 pounds weight etc. Its methods might be move, jump, play, breath etc

PART 2:

1. . Explain about the frame that you have used in your project?




2. What are the different types of Test Automation Frameworks ?

The types of Automation Frameworks are -

1) Linear Scripting - Record & Playback

2) The Test Library Architecture Framework.

3)The Data-Driven Testing Framework.

4)The Keyword-Driven or Table-Driven Testing Framework.



3. How many types of recording modes in QTP? Which will be used when ?

QTP supports 3 types of recording modes

1. Normal mode also called Contextual

2. Low-level recording mode

3.Analog mode

Normal Mode: It is the default recording mode and takes full advantage of QTP's Test Object Model. It recognizes objects regardless of their position on -screen. This is the preferred mode of recoding and is used for most of the automation activities.

Low-level recording mode: This mode records the exact x,y co-ordinates of your mouse operations. It is helpful in testing hashmaps. It is useful for recording objects not identified by normal mode of QTP.

Analog mode: This mode records exact mouse and keyboard "movements" you perform in relation to the screen / application window. This mode is useful for the operation such as drawing a picture, recording signature., drag and drop operations.

4. What are the types object Repositories in QTP.

QTP Supports 2 types of Object Repository

1) Shared Object Repository (also called Global)

2) Per-Action Object Repository, (also called Local)

Per-Action Object Repository is used by default. The extension for Per-Action repository is ".mtr" .

Shared Object Repository is preferable while dealing with dynamic objects which are called in multiple tests. The extension is ".tsr"

5. What is action split and the purpose of using this in QTP?

Action split is to divide an existing action into two parts.The purpose is to divide actions based on their functionality to improve code re-use.

6. Explain how QTP identifies object ?

QTP identifies any GUI Object based on its corresponding properties. While recording, QTP will identify and store peculiar properties (as defined in the Object Identification settings) in the object repository of the GUI object . At run-time, QTP will compare the stored property values with the on-screen properties, to uniquely identify the GUI object.

7. Can we call QTP test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in QTP?

Yes. You can call 4 or even more scripts in your tests.For this, first you will need to make the Actions in the corresponding scripts re-usable.Then from the destination script you can make calls to these re-usable actions.

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

You can use the name property

ex: Browser("name:="xxx"").page("name:="xxxx"").....



OR



We can also use the property "micClass".

ex: Browser("micClass:=browser").page("micClass:=page")....

9. Can we record an application running on a remote machine using QTP ?

Yes .you can record remote application provided you are accessing application through the local browser not via remoter like citrix.

If you are still unable to record it is advisable install QTP and application, on the same machine

10. Can you switch between Per-Action and Shared Object Repository ? If yes how ?

Yes .We can switch. Go to Test--->Settings--->Resources. Here you have an option to choose repositories.

11. What is Step Generator?

Step Generator enables use to Add Test Steps in your script. Using step generator you can add steps to your script without actually recording it.

12. What is an Optional Step ?

A step when declared optional is not mandatory to be executed. If the corresponding GUI object is present, QTP performs the operation on it. If the GUI object is not present, QTP bypasses the optional step and proceeds to execute the next step.

13. How would you export a Script from one PC to another in QTP ?

We can make use of the "Generate Script" function available in Object Identification, Test Settings and Tools/Options tab to create a zip of the script at the source computer. These zip files then can be imported into QTP at the destination computer.

14. How can you handle exceptions in QTP?

In QTP Exceptional handling is done by using

a. Recovery Scenarios.

b. Using “On Error” statement

In Recovery scenario you have to define.

1. Triggered Events.

2. Recovery steps.

3. Post Recovery Test-Run.

At Script Level you can use the On Error Resume Next and On Error Go to 0 statement.

15. What is the difference between functions and actions in QTP?

Actions have their own Object Repository & Data Table. Actions help make your Test modular and increase reuse. Example: You can divide your script into Actions based on functionality like Login, Logout etc.

Functions is a VB Script programming concept and do not have their own Object Repository or Data Table. Functions help in re-use of your code. Ex: You can create a Function in your script to concatenate two strings.