Tuesday, October 7, 2008

QTP FAQ II


1. What is the advantage of using descriptive programming over object repository?

Whenever QTP records any action on an object, it adds some description on how to recognize that object to a repository called as object repository. But sometimes if the description of the object is not available then descriptive programming provides a way to perform action on objects which are not in the object repository. For this purpose one has to provide QTP with a list of properties and values which QTP can use to identify the object on which the operation has to be performed. This technique is mainly useful when the application under test has not yet been developed but its prototype is available.

Advantages of descriptive programming over object repository are:

  • It is dreary to maintain the object repository when its size increases
  • One has to be very careful while using shared repository because if any changes are made then it will affect all the tests associated with it
  • It is also very time consuming to maintain the object repository

2. How to integrate Oracle with QTP?

It is necessary to download the Oracle add-in from the HP site and then install the QTP software. As a result one can record/play back the Oracle applications.

3. What is the difference between web objects and web elements in QTP?

Web object is something which QTP captures while recording a web based application whereas web element is an object which one has to manually add to the script. It is possible to provide a unique description for the object.

4. What is meant by test object and run object in QTP?

Test objects are those objects that one learns from the application under test and stores in the objects repository. Run objects are those objects which QTP recognizes while executing the script. QTP compares the property of the run object in the application to the test object property in the repository.

5. How to use objects of repository of one action from another action?

It is possible to use objects of repository of one action in another provided the objects are in a shared repository. Objects of local object repository cannot be shared across different actions.

6. What is the difference between output values and check points?

Output values are used to get the value of the property during run time and it is visible during run-time in the data table. Checkpoints are used to check the value of a particular property. It generally compares the value of the property of the recorded object with the run-time object for verification.

7. What are the 5 types of objects in QTP?

The five types of objects in QTP are:

  • Standard Windows Objects
  • ActiveX Objects
  • Visual Basic Objects
  • Web Objects
  • Utility Objects

8. What is the use of shared object repository?

Shared object repository is useful when multiple team members are working on the same module. In order to avoid duplicate copies of the same objects in the object repository shared object repository will provide a standard way of adding objects in the Object repository. Merging of different object repository to make a single master Shared object repository is a good testing practice.

9. How to fix an "object not visible" error?

At times during playback of the recorded script, QTP fails to identify some objects as they are not part of the standard object class. To resolve this virtual object wizard can be used to map such objects to a standard class object so that it will be identified by QTP during future execution of the scripts.

10. Explain the different function library extensions used in QTP?

QTP uses 3 different types of function library extensions: .qfl, .vbs and .txt.

.qfl is local to QTP and can only be called and used by QTP whereas .vbs and .txt can be used by QTP and any other application like notepad. All three can be used as QTP function libraries which contain a function that can be used in the test. Another way to use functions is to directly type them in the respective actions. The difference between the .qfl and .vbs file is that one can use breakpoints in .qfl for debugging purpose unlike .vbs files

11. Explain the purpose and usage of Environment variables.

Environment variables are used for parameterization purpose. It is used for either input or output parameter. Environment variables are of two type i.e. internal variable and external variable. Environment parameters are external to the functionality of QTP.

12. How to change a custom object to standard object in QTP?

Custom objects can be defined as virtual objects. It can be mapped to the standard object classes using virtual object manager which is accessed from the Tools menu of QTP.

13. What is the difference between call to existing action & call to copy action?

In “call to existing action” the reference of the action is only copied in the calling action and also the called action is in read only mode. On the other hand in “call to copy action” the original action is copied in the calling action. It is possible to edit the called action.

14. What is the use of Smart Identification?

Smart Identification is a mechanism provided by QTP and used for identifying the objects whenever QTP is unable to identify any object during run time, using Base filter properties or Optional filter properties. This will be seen only in results window and not stored in the Object repository. While the Smart Identification mechanism is more complex, it is also flexible.

15. What is the difference between Object repository and object spy?

Object repository contains all the recorded objects of an application and their properties whereas Object Spy is used to view all the properties of a selected object.

16. Explain about Data Table in QTP.

Data tables are used in QTP for data driven tests. Whenever it required for testing the application action for different values using multiple sets of data then data tables are used. Also it is possible to capture data during runtime and place it in the data table. Data tables are even used for some frameworks like keyword driven framework.

17. How many types of Recoveries are there in QTP?

In QTP there are 4 types of Recoveries which are Popup, Object state, Test run error and Application crash. Recovery is useful while running test scripts in batch mode. During execution if any error is encountered then suitable recovery has to be created for the error. Next when the same error is encountered then the test should not fail instead it has to recover from the error and continue further execution without any manual intervention. The recoveries must be saved after applying it.

18. What is "on error resume next" in QTP?

This statement is used for handling run time errors. If this statement is used in the script then it will close any kind of runtime error messages while executing the script.

19. What is the difference between Action and a Function in QTP?

Action is a part of QTP feature whereas functions are general and coded in VB script. Also actions contain object repository and shared object repository which aids in sharing the script between many users. A function on the other hand is simply a piece of code that returns some desired values.

20. What is TCL?

TCL or Tool Command Language is a powerful and vigorous programming language that is suitable for a variety of applications like web and desktop applications, networking, administration, testing, etc. TCL is used in many of the testing tools and it is open source yet in the evolving stage. It supports many platforms, easily deployed and highly extensible language.

21. What is the use of breakpoints in QTP?

Breakpoints are mainly used for the purpose of debugging a test. When breakpoint is added to a line of code, it is possible to check the exact function of that particular line of code during execution.

22. What is meant by Business Process Testing theory in QTP?

The Business Process Testing theory is a concept where one can divide the application/testing scope into different business components. In turn each of these components is linked to a group of used cases which in turn is mapped to a group of requirements. Next a set of test scenarios are linked to these requirements and each test scenario will map to a set of test cases. As a result of this theory one can easily and effectively track the changes in used cases, requirements or test cases and thus help in efficient management of the application.

23. What are the different types of functions in QTP?

There are two types of functions in QTP i.e. built-in function, eg: instr, date, etc. and user defined function. User defined functions as the name suggests is created by the user as a library of functions which will be used in the test scripts and saved as an external file (eg:*.vbs / *.qfl / *.txt).

24. What is debug viewer in QTP?

The debug viewer is used for the debug purpose during test execution. It consists of 3 tabs i.e. watch, variable and command. Watch function enables the viewing of current value of any variable or VB script expression that is added to the watch tab. This tab is useful during runtime. During a run session, the variable tab displays the current value of all variables that have been recognized till the last step of the script executed. Command tab enables to run a line of script to set or modify the current value of a variable or VBScript object in the function library. During the run session, QTP uses the new value that was set in the command.

25. When is database check point added in a test script?

Data base check point can be added while recording or after recording. It is useful for verifying if a particular value is added to the database or not. But if the checkpoint is added during recording then the Insert statement option will not be available since it is available only when adding a new checkpoint to an existing test script.

26. What are the advantages and disadvantages of shared object repository?

Advantages of Shared object repository are:

SOR does not make copy of the objects that is already present in the repository, it is easy to manage the test script with SOR if the objects in the application are changing, all the objects used by multiple test scripts are maintained in a central location, SOR saves lot of time in renaming a object name because if object name in one test script is changed then it is updated across all the other test scripts where that particular object is used.

Disadvantages of Shared object repository are:

One must be always connected to the Quality Center to work with the SOR in the file system, once the SOR file is saved to the project, changes made to the Quality Center repository file will not affect the project file and vice versa.

27. List the browsers QTP 9.0 supports

QTP supports Firefox 1.5, Netscape 8.0 and Internet Explorer 7.0 browsers.

28. How are test scripts saved in QTP?

Each test script is saved as a separate folder in QTP. Every folder contains data table, lock file, parameters file and action0, action1 folders. Also they contain the object repository file saved as .bdb, script file saved as .mts, and resources file saved as .mtr.

29. What is virtual function?

The base class function is declared as virtual function so that the derived class has only a single copy of that particular function. As a result the base class function is redefined in the derived class.

30. How long will it take for QTP to run an entire test?

It is possible to measure the duration taken by QTP to run a test script by defining transactions. One can use start transaction and stop transaction and then by calculating the difference between the two transactions one can get the time taken for executing the entire test or a section of the test.

31. What are checkpoints in QTP?

A checkpoint basically validates the actual value with the expected value while executing a test script. Eight types of checkpoints can be added to the test for standard web objects in QTP. They are:

  • Page checkpoint that checks the characteristics of an application
  • Text checkpoint verifies whether a particular text string is displayed appropriately in the application.
  • Object checkpoint checks the values of an object in the application
  • Image checkpoint matches the coordinate values of an image in the application
  • Table checkpoint verifies information within a table in the application
  • Accessibility checkpoint checks the web page for Section 508 compliance
  • XML checkpoint checks the contents of individual XML data files or documents that are part of the web application
  • Database checkpoint checks the contents of database accessed by the application

32. What is input and output parameter in QTP?

Input parameter is used with functions and procedures to pass the input values from the calling test to perform the function’s action whereas output parameter is used with functions to return the output value to main or calling test.

33. What is meant by developed and enhanced script?

Once the application under test is executed and recorded the script is generated. But if the next time while running the test if it is required to modify the script according to the expected result then it has to be enhanced accordingly. In case if the previous release of the application has been changed then the script also need to be developed to incorporate the changes in the application.

34. What is ActiveX control in QTP?

In QTP add-ins or controls can be added according to the application type. Incase if the application contains any ActiveX objects then QTP identifies those using the ActiveX control.

35. What is a file system object in QTP?

In QTP file system object is a predefined object that allows users to access the external files and perform various operations like reading data from files, writing/appending data to file, opening/creating/deleting a file by using different methods of the file system object.

36. Is QTP case sensitive?

QTP is not case sensitive.

37. Is it necessary to learn VB script to work with QTP?

It is not mandatory to be proficient in VB script to work with QTP. But one should be familiar with the basic VB script concepts so that one can understand the script generated by QTP although the tool is quite user friendly.

38. What are the advantages of QTP when compared to Winrunner?

QTP has more advanced features when compared to Winrunner. QTP is easier to use and implement for both technical and non-technical testers when compared to Winrunner. Unlike Winrunner QTP offers a Tree view which is an icon-based view of the script which is non-technical and quicker to adapt. QTP uses VBScript as a programming language which is very powerful and has lots of available resources unlike Winrunner which uses TSL as a programming language. Active screen is another good feature in QTP which is not in Winrunner.

39. What are the advantages and disadvantages of per-test object repository?

Advantages of per-test object repository are:

During the recording of an application QTP automatically stores all the information of the objects it comes across and stores it in the repository, when the test script is saved the object repository of that test is also automatically saved with the test. The OR cannot be accessed as a separate file.

Disadvantages of per-test object repository are:

Changing the test object properties, values, or names in one object repository of a particular test does not affect the information stored for the same test object in another object repository or in other tests. This makes the modification process very cumbersome, if objects are added to one of the split actions then the new objects are added only to the corresponding action object repository.

40. How many types of frameworks are there in automation?

There are four types of frameworks in automation i.e. Test script modular framework (linear modular framework), Key word driven framework (built in QTP), Data driven framework and Test library architecture framework. There is another hybrid framework which is combination of the above four frameworks.

41. What is the use of virtual object wizard in QTP?

It is possible to teach QTP to recognize any area of the application as an object by defining it as a virtual object. Using the Virtual object wizard one can map a virtual object to a standard object class, specify the boundaries and the parent of the virtual object and then assign it a logical name.

42. In QTP how many types of data tables are available?

There are two types of data table in QTP which are Global and Local. Global data table is accessible from every action in a test whereas local data table is specific to a particular action in a test. The data in these tables can only be accessed from their associated action.

43. What is Step Generator?

Step Generator is a feature available in QTP which is used to insert a statement or generate script without recording or typing it in the Expert view.

44. Can QTP scripts be opened without opening the QTP tool?

It is possible to open the QTP scripts without opening the QTP tool by an option provided in QTP called as the silent test runner.

45. What is meant by Keyword view and Expert view in QTP?

Keyword view displays the test procedure as a Tree view of Actions and functions whereas in the expert view one can display and edit the code of the test script.

46. What is meant by external action?

External actions in QTP are those actions that are called from other tests but cannot be modified inside the test that they are called in since they will be in read only mode.

47. What is meant by synchronization?

Generally QTP does not wait for specific period of time for a object to get the required status. Hence the process of giving specific wait time for an object to attain the required status is known as synchronization.

48. What is Keyword driven testing?

Keyword driven testing is the way of testing without writing the code. Here one need to select the object properties and the functions which are required to do the operations on and the necessary parameters should also be declared. Keyword-driven testing separates much of the programming work from the actual test steps so that the test steps can be developed earlier and be maintained with only minor updates even if the application requirements changes significantly.

49. What is the advantage of using QTP for testing SAP application?

QTP is very flexible and user-friendly to write script for any technology by using the add-ins. On the other hand tool like eCATT can test only in SAP GUI and has limited error handling and checkpoint capabilities. In order to test the SAP application with more flow controls QTP is a good option.

50. How to increase the execution speed of tests in QTP?

Few precautionary steps like removing the unnecessary lines of code, making use of descriptive programming and optimizing the overall test script the execution and quality of the test can be greatly improved.

No comments: