Wednesday, April 8, 2009

QTP Interview Questions 5

1. How to add a Run-time parameter data sheet?

Datatable.localsheetThe following example, uses the Local Sheet property to return the Local Sheet of the run time data table in order to add a parameter(column) to it.My parameter = DataTable. LocalSheet.AddParameter(”Time”, “5.45″)

2. What scripting language is used in QTP?VB scripting

3. Analyzing the Checkpoint resultsStandard Checkpoint : By adding standard checkpoints to your checks or components, you can compare the expected values of objects properties to the object’s current values during the run session, if the results doesn’t match the check point fails.

4. How to create a Run-time property for an object?

5. Table and DataBase(DB) checkpointsBy adding Table checkpoints to your tests or components we can check that a specified value is displayed in a cell in a table on your application. By adding DB checkpoints to your tests or components you can check the contents of database accessed by your application. The Results displayed for table and database checkpoints are similar. When you run tests or components QTP compares the expected results of the checkpoints 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 objects. To add a table checkpoint you use the checkpoint properties of dialog box. Table checkpoints are supports for web and ActiveX applications as well as for variety of External Add-in environments.You can use Database checkpoints in your tests or components to check databases accessed by your websites or application and to delete 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 QTP by default as well as for 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 checkpoints time out option is available only when creating a table checkpoint.That is not available when creating a database checkpoints.

6. Checking Bitmaps.You can check an area of a web page or application as bitmap. While creating a test or a components you specify the area you want to check by selecting an object. You can check an entire object or any area with in an object. QTP captures the specified object as bit map 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 QTP compares the object or selected area of the object currently displayed of the web page or the application with the bitmap stored when the test or component was recorded. If there are any differences QTP captures 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 the test results of a checkpoint, see viewing checkpoint results.For example, suppose you have a website that can display a map of a city the user specify that map has control keys for zooming.You can record the new map i.e displayed after one check 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 checkpoint, all supported testing environments (as long as the appropriate add-ins are loaded)

Note: The result of bitmap check point may be effected by factors such as OS, Screen Resolutions and color settings.

7. Text/Text area checkpointIn the Text/Text area checkpoint propertied 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 the run sessionNote: In windows based environment. If there is more than one line of text selected, the checkpoint summary pane display (complex value ) instead of the selected text for the checkpoint.QTP automatically displays the checked text in red and the text before and after the checked text in blue.For text area checkpoints only the text string captured from the defined area is displayed(Text before and text after are not displayed)To designate the parts of the captured string as checked text and other parts as text before and text after, click configure button.The configure text selection dialog box opens.Checking XML : XML (Extensible Markup language)is a Meta-Markup language for test documents i.e endorsed as a standard by the WC3.XML makes the complex data structure portable between different computer environments or operating systems and programming languages, facilitating the sharing of data.XML files contain text with simple tags that describe the data within an XML documents these describe the data content, but not the presentation of the data.Application that display and XML documents or file use either cascading style sheets of the 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 belowAn XML file can be a static data file i.e 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 be changes over time it is normally quite static.You can use an XML checkpoint to validate that the data has not changed from one application released to another.An XML file can consists of elements with attributes and values(character data).There is parent and child relationship between the elements, and elements can have attributes associated with them. If any part of the structure(including data) changes the applications ability to process the XML file may be effected. Using an XML checkpoint you can check the content of an element to make sure that its, attributes, and values have not changed.XML files are often an intermediary that retrieves dynamically changing data from 1 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 needed a well defined structure in order to be portable across platforms and development systems. One way to accomplish elements this is by developing and XML scheme which describes the structure of XML elements and data types. You can use scheme validation to check that each item of content in an xml file adheres to the scheme description of the elements in which the content is to be placed