Thursday, March 20, 2008

FAQ - Automation - QTP (161 to 170)

161. How to retrieve the property of an object?

using “GetRoProperty”.

162. How to open any application during Scripting?

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 )

163. How to covert a String to an integer?

CInt()—> a conversion function available.

164. How you can enhance your test?

There are a variety of options to enhance your test:

(1) You can add checkpoints to your test. A checkpoint is a step in your test that compares the values of the specified property during a test run with the values stored for the same test object property within the test. This enables you to identify whether or not your Web site or application is functioning correctly.

(2) You can parameterize your test to replace fixed values with values from an external source during your test run. The values can come from a Data Table, environment variables you define, or values that QuickTest generates during the test run.

(3)You can retrieve values from your test and store them in the Data Table as output values. You can subsequently use these values as an input parameter in your test. This enables you to use data retrieved during a test in other parts of the test.

(4) You can divide your test into actions to streamline the testing process of your Web site or application.

(5)You can use special QuickTest options to enhance your test with programming statements. The Step Generator guides you step-by-step through the process of adding recordable and non-recordable methods to your test. You can also synchronize your test to ensure that your application is ready for QuickTest to perform the next step in your test, and you can measure the amount of time it takes for your application to perform steps in a test by defining and measuring transactions.

(6)You can also manually enter standard VBScript statements, as well as statements using QuickTest test objects and methods, in the Expert View.

165. Explain different recording modes?

QuickTest’s normal recording mode records the objects in your application and the operations performed on them. This mode is the default and takes full advantage of QuickTest’s test object model, recognizing the objects in your application regardless of their location on the screen. Analog Recording - enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. In this recording mode, QuickTest records and tracks every movement of the mouse as you drag the mouse around a screen or window. This mode is useful for recording operations that cannot be recorded at the level of an object, for example, recording a signature produced by dragging the mouse.

Note: You cannot edit analog recording steps from within QuickTest. ?

Low-Level Recording - enables you to record on any object in your application, whether or not QuickTest recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or WinObject test objects. Use low-level recording for recording tests in an environment or on an object not recognized by QuickTest. You can also use low-level recording if the exact coordinates of the object are important for your test. Note: Steps recorded using low-level mode may not run correctly on all objects.

166. What is parameter?

A parameter is a variable that is assigned a value from an external data source or generator. If you wish to parameterize the same value in several steps in your test or component, you may want to consider using the Data Driver rather than adding parameters manually.

167. How many types of parameters are there?

There are four types of parameters:

1. Test, action or component parameters

2. Data Table parameters

3. Environment variable parameters

4. Random number parameters Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.0 Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component.

168. How Does Run time data (Parameterization) is handled in QTP?

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.

169. Explain about the Test Fusion Report of QTP ?

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.

170. How QTP recognizes Objects in AUT?

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.

No comments: