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.

Sunday, October 5, 2008

Frequently Asked Questions ( FAQs)

Below are few faqs on qtp ....follow this for more more real time faqs


1. How is the Run time data (Parameterization) handled in QTP?
A) You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.

2) What is keyword view and Expert view in QTP?
A) QuickTest’s Keyword Driven approach, test automation experts have full access to the underlying test and object propertyes, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that QuickTest Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

3) Explain about the Test Fusion Report of QTP ?
A) Once a tester has run a test, a TestFusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining TestFusion reports with QuickTest Professional, you can share reports across an entire QA and development team.

4) To which environments does QTP supports ?
A) QuickTest Professional supports functional testing of all enterprise environments, including Windows, Web, ..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.

5) What is QTP ?
A) QuickTest is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications…

6) Explain QTP Testing process ?
A) The QuickTest testing process consists of 6 main phases:
Create your test plan
Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
Recording a session on your application
As you navigate through your application, QuickTest graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
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 identify whether or not your application is functioning correctly.
NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process.

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 statements to your test enables you to add sophisticated checks to your test.

7) How is Debugging done in QTP
A)Debugging your test
If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
Running your test on a new version of your application
You run a test to check the behavior of your application. While running, QuickTest connects to your application and performs each step in your test.
Analyzing the test results
You examine the test results to pinpoint defects in your application.
Reporting defects
As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

8)How QTP recognizes Objects in AUT?
A) QuickTest stores the definitions for application objects in a file called the Object Repository. As you record your test, QuickTest will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the QuickTest script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.

9) What are the types of Object Repositorys in QTP?
A) QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, QuickTest automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.

10) Explain the check points in QTP?
A) 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 Accessiblity 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.
A database checkpoint checks the contents of databases accessed by your web site

11) In how many ways we can add check points to an application using QTP.
A) 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).

12) How does QTP identifes the object in the application
A) QTP identifies the object in the application by LogicalName and Class. For example : The Edit box is identified by Logical Name : PSOPTIONS_BSE_TIME20Class: WebEdit

13) 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?
A) QTP handles those situations using “Regular Expressions”.

14) What is Parameterizing Tests?
A) 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.

15) What is test object model in QTP ?
A) 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 ofrelevant methods that QuickTest can record for it.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 onwhich methods are performed during the run session.When you perform an operation on your application while recording,QuickTest:➤ identifies the QuickTest test object class that represents the object on whichyou performed the operation and creates the appropriate test object➤ reads the current value of the object’s properties in your application andstores the list of properties and values with the test object➤ chooses a unique name for the object, generally using the value of one of itsprominent properties➤ records the operation that you performed on the object using the appropriate QuickTest test object methodFor example, suppose you click on a Find button with the following HTMLsource code:
QuickTest identifies the object that you clicked as a WebButton test object.It creates a WebButton object with the name Find, and records the followingproperties and values for the Find WebButton:It also records that you performed a Click method on the WebButton.QuickTest displays your step in the Keyword View like this:QuickTest displays your step in the Expert View like this:Browser(”Mercury Interactive”).Page(”Mercury Interactive”).WebButton(”Find”).Click

16) What is Object Spy in QTP?
A) Using the Object Spy, you can view the properties of any object in an openapplication. You use the Object Spy pointer to point to an object. The ObjectSpy displays the selected object’s hierarchy tree and its properties and valuesin the Properties tab of the Object Spy dialog box.

17. Supported Check-Points in QTP? What is the Diff between Image check-point and Bit map Check point?
A) 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 inthe 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 are loaded).Note: The results of bitmap checkpoints may be affected by factors such asoperating system, screen resolution, and color settings.

18) How many ways we can parameterize data in QTP ?
A) There are four types of parameters:Test, action or component parameters enable you to use values passedfrom 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, oriteration, QuickTest uses a different value from the Data Table. Environment variable parameters enable you to use variable values fromother sources during the run session. These may be values you supply, orvalues that QuickTest generates for you based on conditions and optionsyou choose. Random number parameters enable you to insert random numbers asvalues in your test or component. For example, to check how yourapplication handles small and large ticket orders, you can have QuickTestgenerate a random number and insert it in a number of tickets edit field.

19) Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?
A) Inserting a call to action will only Import the columns of the Action called

20. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
A) 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.

21. If i give some thousand tests to execute in 2 days what do u do?
Ans : Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.

22. What does it mean when a check point is in red color? what do u do?
Ans : A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Envronment Issue or a Application issue.

23. what do you call the window testdirector-testlab?
Ans : “Execution Grid”. It is place from where we Run all Manual / Automated Scripts

24. How do u create new test sets in TD
Ans : 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.

25. 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

26. if i give some thousand tests to execute in 2 days what do u do?
Ans : Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.

27. what does it mean when a check point is in red color? what do u do?
Ans : A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Envronment Issue or a Application issue.

28. what do you call the window testdirector-testlab?
Ans : “Execution Grid”. It is place from where we Run all Manual / Automated Scripts

29. how do u create new test sets in TD
Ans : 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.

30. How to Import data from a “.xls” file to Data table during Runtime.
Ans : Datatable.Import “…XLS file name…” DataTable.ImportSheet(FileName, SheetSource, SheetDest) DataTable.ImportSheet “C:\name.xls” ,1 ,”name”

31. How to export data present in Datatable to an “.xls” file?
Ans : DataTable.Export “….xls file name…”

32. How to covert a String to an integer?
Ans : CInt()—> a conversion function available.

33.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.

34. 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.

35. How to verify the Cursor focus of a certain field?
Ans : Use “focus” property of “GetRoProperty” method” 6 1. Any limitation to XML Checkpoints? Ans : Mercury has determined that 1.4MB is the maximum size of a XML file that QTP 6.5 can handle

36. Syntact for how to call one script from another? and Syntax to call one “Action” in another?
Ans: RunAction ActionName, [IterationMode , IterationRange , Parameters] Here the actions becomes 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.

37. How to export QTP results to an “.xls” file?
Ans : (a) By default it creates an “XML” file and displays the results

38. 3 differences between QTP & Winrunner?
Ans : (a) QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting. (b) QTP supports “.NET” application Automation not available in Winrunner (c) QTP has “Active Screen” support which captures the application, not available in WR. (d) QTP has “Data Table” to store script values , variables which WR does not have. (e) 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.

39. Does QTP is “Unicode” compatible?
Ans : QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatabile by end of December 2004.

40. how to add a runtime parameter to a datasheet?
Ans: DataTable.LocalSheet 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″)

41. What scripting language is QTP of?
Ans : Vbs (VB Script)

42. How can we Analyze the Checkpoint results Standard Checkpoint :
Ans :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.

43.Table and DB Checkpoints:
Ans :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: (a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office. (b) 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

44.Checking Bitmaps:
Ans :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. 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 more information on test results of a checkpoint, see Viewing Checkpoint Results. 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 are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

45.Text/Text Area Checkpoint :
Ans :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. QuickTest 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 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 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.

46 . Object Repositories types, Which & when to use?
Ans :Deciding Which Object Repository Mode to Choose 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.

47. Can we Script any test case with out having Object repository? or Using Object Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.

48. How to execute a WinRunner Script in QTP?
Ans : (a) 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

49. How to handle Run-time errors?
Ans :(a) 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

50. How to change the run-time value of a property for an object?
Ans : 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

51. How to retrieve the property of an object?
Ans : using “GetRoProperty”.

52. How to open any application during Scripting?
Ans : SystemUtil , object used to open and close applications and processes during a run session. (a) 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 test E.g : SystemUtil.Run “Notepad.exe” SystemUtil.CloseDescendentProcesses ( Closes all the processes opened by QTP )
53. 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.

54. What is the extension of script and object repository files?
Ans : Object Repository : .tsr ,
Script : .mts, Excel : Default.xls

55. How to supress warnings from the “Test results page”?
Ans : From the Test results Viewer “Tools > Filters > Warnings”…must be “Unchecked”. 55. When we try to use test run option “Run from Step”, the browser is not launching automatically why? Ans : This is default behaviour.


Saturday, October 4, 2008

Automated Test Script Creation



Debugging and troubleshooting test scripts becomes extremely tedious when the test script has hundreds of lines of code, verification points, branching logic, error handling, parameters, and test correlation among various recorded business processes. A more manageable approach to debugging complex and lengthy test scripts is to record portions of the script and debug those portions individually before recording other parts of the test script. After testing individual portions, you can determine how one portion of the test script works with another portion and how data flows from one recorded process to the other. After all sections for a test script have been recorded, you can playback the entire test script and ensure that it properly plays back from the beginning to the end with one or more sets of data.
Always create a test plan that will assist in the creation of the regression test script. A test script is only as good as the planning that takes place before it is written. This saves time and organizes the process.
Remember that all regression test scripts will be written to run in the QA environment as well as the production environment. The automated regression test use will be a part of the production test used to determine if a build truly does function as expected in production.
To manage the creation and edit of our automated regression tests QA will create automated tests in the following manner:
1. Record each individual process such as logging in and logging out. Save those recordings on your desktop.
2. Verify that the script will play back with no errors.
3. Continue recording and playing back throughout the test script creation process, verifying the script will play back with each step taken.
4. Add multiple sets of data driven tests for each individual portion of each test where that kind of test is applicable.
5. Verify the individual test scripts with multiple sets of data will play back with no errors.
6. Add various check points throughout the test.
7. Verify the individual test scripts with various check points will play back with no errors.
8. Now integrate all recorded processes into one large test script.
9. Verify the large test script will play back with no errors.


The key here is to ensure that each recorded process plays back successfully before proceeding to record the remaining portions of the entire test script. Do not string the individual tests together for playback without first verifying that all of the processes could play back successfully as individual processes.
Lesson to be learned here is to never, EVER wait to debug a script until the entire test script has been recorded.

Synchronization
Since QTP can play back recorded test scripts much faster than an end-user’s manual keystrokes all tests must be synchronized. Introduce artificial wait times in the test scripts to make sure the script will run appropriately without errors unattended. Take into account the fact that there will be times when the script will need to run slower than a manual test due to network issues, etc. The goal here is we want to make sure the scripts will run unattended through Test Director. Slowing down a script with wait times is not very scientific and does not contribute to the creation of a robust automated test script that plays back successfully without user intervention. That said, sync times will be edited after the test script has been written in its entirety and has been tested to ensure it runs with no errors.
Signed-off, Peer Reviewed
As part of the test readiness review criteria, test scripts will be formally accepted and approved prior to starting the test cycle. QA, Business Analysts and Developers should be involved in approving recorded test scripts. The QA Analyst writing the automated test script should demonstrate that the test script successfully plays back in the QA environment and, if possible, with various sets of data.
Recording, Playing Back Against Hidden Objects
Scripts might be recorded to populate or double click values for a field within a table grid or an array where the location of this field is not fixed. If the field’s location within a table grid or array changes from the time it was recorded, the script might fail during play back. Test scripts often fail during play back because the locations of objects that are not displayed or visible within the screen have changed.
In order to play back scripts that are location sensitive or where the location is subject to change, it might be necessary to enhance the script with functionality such as ‘scroll down’, ‘next page’, or ‘find’. Including such utilities ensures that hidden objects requiring play back will be identified, and/or double clicked regardless of their location within an array, table grid, or the displayed screen.
Create Automatic Notification for Critical Scripts
Test scripts should be enhanced with error handling programming logic that instantly sends error messages to a tester’s e-mail address when problems occur. Since some test scripts are business critical and must run as batch jobs in the middle of the night we need to know if something failed as soon as possible. The proper and successful execution of these business critical test scripts can serve as a dependency or pre-condition for other automated tasks. Always include logic in business critical test scripts that automatically sends notification in the event of a failure.
Documentation
To make test scripts reusable and easier to maintain, please document all relevant information for executing the test script, a test script header, and any special conditions for execution of the test script. Example:
1. Adjust dates within the application in QA environment for running reports.
2. Update any fields that require unique data.
3. Display settings for context sensitive/analog/bitmap recording.
4. List other test scripts that are dependencies.
5. Specify necessary authorization levels or user roles for executing the script.
6. Conditions under which the script can fail and work around for re-launching the script.
7. Applications that need to be either opened or closed during the script execution.
8. Specific data formats, etc.
Scripts should contain a header with a description (example: what it is used for) and its particular purpose (example: regression testing). The script header should also include the script author and owner, creation and modification date, requirement identifiers that the script traces back to, the product the script supports and the number of variables and parameters of the script. Providing this information in the test script header facilitates the execution, modification, and maintenance of the script for future testing efforts.

Friday, October 3, 2008

Overview of QTP


Please follow the following topics in order to learn QTP with Professional approach


Understanding QTP

Record and Playback process

Recording Operations

Introduction to Object Repository

Record and Run Settings


Recording Types

Standard Recording

Analog Recording

Low level Recording



Working with QTP

QTP Standard Views

Keyword view

Expert View

Active screen view

Active Screen benefits

Comparison of Different Views

Using Step Generator

Transaction Response Time


Introduction to Parameterization

Why Parameterization

Data Driven Tests

Types of Data tables (Local and Global)

Parameterize using Datatables


Actions

How to create a new action

Call to existing action

Call to copy of action

Split Action

Calling Winrunner Tests and Functions
Adding Validations to Script

Using Checkpoints

Types of Checkpoints

Using Output Values

Types of Output Values

Adding Validations programmatically

Update Run mode


Parameterization

Environment Variables

Parameterize using Environment Variables

Using Environment variables in Checkpoints

Using Environment variables in Output values

Using Environment variables in Object Repositories

Action Parameters

Test Parameters

Passing values from Test Parameters to Action Parameters

Passing values from Environment variables to Action Parameters

Passing values from Data table to Action Parameters

Parameterising Checkpoints and Output Values using Environment Variables and Data tables


Working with Dynamic Objects

Introduction to Dynamic Objects

Regular Expressions

Introduction to Regular expression

Using Regular expressions in Checkpoints

Using Regular expressions Object Repository

Using Regular expressions QTP Editor

Virtual Objects

Descriptive Programming

Using Different methods of Descriptive Programming

Why Descriptive Programming

Using ChildObjects method

Using ChildItem method

Object Spy feature


Synchronization

Using Different settings for Synchronization

Using Wait and Sync Statements


QTP Settings and Options

Test Settings

Options

Object Identification

Smart Identification

Working with Objects

Object Repositories

Types o How to use these repositories

Advantages/Disadvantages

How to choose

Object Repository Merge Tool

Object Repository Manager

Managing shared repositories

Exporting Repository content to XML format

Importing Repository content from XML format

Updating objects details from local repository

Mapping Repository parameters

Object Model Reference

Test Object model

Execution of Scripts

Different Run options

Executing QTP Script with Quality Center

Test Results

Analysis of Test Results

Reporting

Types of Reporting

Reporting Functions

Recovery Management

Defining Recovery scenarios

Types of Event triggers

Recovery operations

Post Recovery Options

Controlling Recovery Scenarios Programmatically

QTP Vs Other Automation Tools - Features comparison
Working with Databases and File Systems
Programming/Scripting

Extracting data from web tables

Working with Dynamic links

Obtaining object from web tables at run time

Dynamic objects and how to resolve

Project automation

Live Project Automation

Implementation of all features of QTP in different scenarios

Discussion about common Issues and Solving them
****All the best****

Sunday, September 28, 2008

Welcome to all aspring QTP Gurus

Hello Friends

Let me Introduce myself........Iam an Automation Expert with over 4 years of experience in various industries like Telecom, Banking, Insurance, Financial Services, Manufacturing, Retail, etc., on Web Applications and Client Server Applications.
Today I had this idea of sharing my knowledge with all the aspiring Quality Assurance Analysts and thus helping them to finesse their inherent talents. Iam going to add information related to QTP periodically. All the information posted is a collection from different sources like web, books, experiences of mine and my friends, etc.,. Please provide feedback to help me improve the blog. U r the QA Analysts for this blog, which needs a continous testing and bug tracking. Exhibit your QA talent by pointing out the errors in my posts.

Thanking You

Vishu
vishugene@gmail.com