Quicktest Professional Questions

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Quicktest Professional Questions as PDF for free.

More details

  • Words: 4,673
  • Pages: 9
QuickTest Professional Questions and Answers: What is QTP? 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... QTP is Mercury Interactive Functional Testing Tool. QTP stands for Quality Test Professional. Features & Benefits of Quick Test Professional? * Key word driven testing * Suitable for both client server and web based application * Vb script as the scriot language * Better error handling mechanism * Excellent data driven testing features Differences between QTP & WinRunner? * QTP is object bases Scripting (VBS) where Winrunner is TSL (C based) Scripting. * QTP supports ".NET" application Automation not available in Winrunner * QTP has "Active Screen" support which captures the application, not available in WR. * QTP has "Data Table" to store script values , variables which WR does not have. * 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. To which environments do QTP supports? 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. What’s the QTP testing process? QTP testing process consists of seven steps1.Create your test plan 2.Recording 3. Enhancing your script 4. Debugging 5. Run 6. Analyze 7. Report Defects (more…). 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.

PRABU M

[email protected]

Page: 1

Adding logic and conditional statements to your test enables you to add sophisticated checks to your test 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. How to do Laod testing for web based Application? 1. 2. 3. 4.

Recording a scenario in QTP of my web based application. Make 100 copies of that scenario and run the test (scenario run for 100 times) In that case, do the load of application on server. The basic logic of running the copy 100 times is to create same scenario as if 100 users were working.

What's QuickTest Window? The QuickTest window contains the following key elements: * * * * * * *

Title bar—Displays the name of the currently open test. Menu bar—Displays menus of QuickTest commands. File toolbar—Contains buttons to assist you in managing your test. Testing toolbar—Contains buttons to assist you in the testing process. Debug toolbar—Contains buttons to assist you in debugging tests. Test pane—contains the Keyword View and Expert View tabs. Active Screen—provides a snapshot of your application as it appeared when you performed a certain step during the recording session. * Data Table—assists you in parameterizing your test. * Debug Viewer pane—Assists you in debugging your test. The Debug Viewer pane contains the Watch Expressions, Variables, and Command tabs. (The Debug viewer pane is not displayed when you open QuickTest for the first time. You can display the Debug Viewer by choosing View < Debug Viewer.) * Status bar—displays the status of the QuickTest application. * Test Tree - It provides graphical representation of your operations which you have performed with your application. How many Add-INS comes by default with QTP? There are 3 Add-ins comes with QTP: (1) ActiveX (2) Visual Basic (3) Web What are the views available in QTP? (1) Keyword View (2) Expert View Two Types of data tables Global data sheet: Accessible to all the actions Local data sheet: Accessible to the associated action only What is Active Screen? The Active Screen provides a snapshot of your application as it appeared when you performed a certain step during a recording session. How many toolbars QTP has? QuickTest has 4 built-in toolbars: 1. The File toolbar 2. The Testing toolbar 3. The Debug toolbar 4. Action toolbar. The Action toolbar is available in the Keyword View and contains options that enable you to view all actions in the test flow or to view the details of a selected action. The Action toolbar is not available for components. What’s the basic concept of QTP? QTP is based on two concept* Recording * Playback Which scripting language used by QTP? QTP using VB scripting. How many types of recording facility are available in QTP?

PRABU M

[email protected]

Page: 1

QTP provides three types of recording methods* Context Recording (Normal) * Analog Recording * Low Level Recording How many types of Parameters are available in QTP? QTP provides three types of Parameter* Method Argument * Data Driven * Dynamic What is the extension of script and object repository files? Object Repository: .tsr, Script: .mts, Excel: Default.xls How to suppress warnings from the "Test results page"? From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked". What is object Repository? Explain different types of Object Repositories? QuickTest identifies objects in your application based on a set of test object properties. It stores the object data it learns in the object repository. You can save your objects either in a shared object repository or in action object repository. In shared object repository mode, you can use one object repository file for multiple tests or components. In object repository peraction mode, QuickTest automatically creates an object repository file for each action in your test. Object repository peraction mode is not available for components. What are the types of Object Repositorys in QTP? QuickTest has two types of object repositories for storing object information: In per-action mode, QuickTest automatically creates an object repository file for each action in your test so that you can record and run tests without creating, choosing, or modifying object repository files. If you do make changes to an action object repository, your changes do not have any effect on other actions or other tests. In shared mode, you can use one object repository file for multiple tests if the tests include the same objects. Object information that applies to many tests is kept in one central location. When the objects in your application change, you can update them in one location for multiple tests. What is Object Spy in QTP? Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box. How QTP does identify the object in the application? QTP identifies the object in the application by LogicalName and Class. For example: The Edit box is identified by Logical Name: PSOPTIONS_BSE_TIME20 Class: WebEdit How will you add Dynamic objects to Object repository? Using SetToProperty What is the file extension of the code file & object repository file in QTP? File extension of Per test object rep :- filename.mtr Shared Object rep :- filename.tsr Code file extension id:- script.mts What is Smart Identification mechanism? QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognize the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. The Smart Identification mechanism uses 2 types of properties:

PRABU M

[email protected]

Page: 1

Base filter properties— the most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value; you could no longer call it the same object. Optional filter properties— other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable. What is Virtual object wizard in QTP? Using the Virtual Object Wizard, you can map a virtual object to a standard object class, specify the boundaries and the parent of the virtual object, and assign it a name. You can also group your virtual objects logically by assigning them to collections What do you mean by iteration? Each run session that uses a different set of parameterized data is called an iteration. What’s the Transaction? You can measure how long it takes to run a section of your test by defining transactions. What is output value? An output value is a value retrieved during the run session and entered into your Data Table or saved as a variable or a parameter. Each run session that uses a different set of parameterized data is called iteration. What is check point? A checkpoint checks specific values or characteristics of a page, object, or text string and enables you to identify whether or not your Web site or application is functioning correctly. A checkpoint compares the value of an element captured in your test when you recorded your test, with the value of the same element captured during the test run. Checkpoint Type

Description

Example of Use

Standard Checkpoint

Checks values of an object's properties.

Check that a radio button is selected.

Image Checkpoint

Checks the property values of an image.

Check that the image source file is correct.

Table Checkpoint

Checks information in a table.

Check that the value in a table cell is correct.

Page checkpoint

Checks the characteristics of a Web page.

Check how long a Web page takes to load or if a Web page contains broken links.

Text / Text Area Checkpoint

Checks that a text string is displayed in the appropriate place in a Web page or application window.

Check whether the expected text string is displayed in the expected location on a Web page or dialog box.

Bitmap Checkpoint

Checks an area of a Web page or application after capturing it as a bitmap

Check that a Web page (or any portion of it) is displayed as expected.

Database Checkpoint

Checks the contents of databases accessed by an application or Web site

Check that the value in a database query is correct.

Accessibility Checkpoint

Identifies areas of a Web site to check for Section 508 compliancy.

Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines.

XML Checkpoint

Checks the data content of XML documents.

Note: XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page.

Different types of checkpoints? Standard, Image, Table, Text, Text Area, Bitmap, Accessibility, XML, Page, Database

PRABU M

[email protected]

Page: 1

What is the Diff between Image check-point and Bit map Check point? 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. 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. Why use Regular Expressions? You created a text checkpoint that searched for a specific text string. You can use regular expressions to increase the flexibility and adaptability of your tests. Regular expressions enable QuickTest to identify objects and text strings with varying values. You can use regular expressions when defining the properties of an object, the methods of an argument, when parameterizing a step, and when creating checkpoints with varying values. What are the Features & Benefits of Quick Test Pro (QTP)..? 1. 2. 3. 4. 5.

Key word driven testing Suitable for both client server and web based application Vb script as the scriot language Better error handling mechanism Excellent data driven testing features

How many types of Actions are there in QTP? There are 3 kinds of actions: Non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once. Reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests. External action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action. How to handle the exceptions using recovery scenario manager in Qtp? You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run What is the use of Text output value in Qtp? Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table. 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. 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 In How many ways we can add check points to an application using QTP. We can add checkpoints while recording the application or we can add after recording is completed using Active screen

PRABU M

[email protected]

Page: 1

(Note: To perform the second one The Active screen must be enabled while recording). Why divide a test into three action calls? When you create a new test, it contains a call to one action. By dividing your tests into calls to multiple actions, you can design more modular and efficient tests. If I give some thousand tests to execute in 2 days what do u do? Adhoc testing is done. It covers the least basic functionalities to verify that the system is working fine. 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 QTP does handles? QTP handles those situations using “Regular Expressions. Can we Script any test case with out having Object repository? Or Using Object Repository is a must? No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available. What are the properties you would use for identifying a browser & page when using descriptive programming? "name" would be another property apart from "title" that we can use. OR We can also use the property "micClass". ex: Browser("micClass:=browser").page("micClass:=page").... I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this? U can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad "( i.e., where the notepad.exe is stored in the system) in the "Windows Applications Tab" of the "Record and Run Settings window. Try it out. All the Best. If an application name is changes frequently i.e while recording it has name, in this case how does QTP handles? IF we use batch testing the result shown for last action only. In that how can I get result for every action? You can click on the icon in the tree view to view the result of every action How to Import data from a ".xls" file to Data table during Runtime? Datatable.Import "...XLS file name..." DataTable.ImportSheet(FileName, SheetSource, SheetDest) DataTable.ImportSheet "C:\name.xls" ,1 ,"name" How to export data present in Datatable to an ".xls" file? DataTable.Export "....xls file name..." Syntax for how to call one script from another? and Syntax to call one "Action" in another? 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. How to export QTP results to an ".xls" file? By default it creates an "XML" file and displays the results How the exception handling can be done using QTP? It can be done Using the Recovery Scenario Manager which provides a wizard that gudies you through the process of defining a recovery scenario. FYI.. The wizard could be accesed in QTP> Tools-> Recovery Scenario Manager How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. What is the difference between them? how to handle script issues?

PRABU M

[email protected]

Page: 1

Yes, there's an in-built functionality called "Step Generator" in Insert->Step->Step Generator -F7, which will generate the scripts as u enter the appropriate steps. What is the difference between check point and output value. An output value is a value captured during the test run and entered in the run-time but to a specified location. EX:-Location in Data Table[Global sheet / local sheet] What is the difference between Call to Action and Copy Action.? Call to Action : The changes made in Call to Action , will be reflected in the orginal action( from where the script is called).But where as in Copy Action , the changes made in the script ,will not effect the original script(Action) How to verify the Cursor focus of a certain field? Use "focus" property of "GetRoProperty" method" Any limitation to XML Checkpoints? Mercury has determined that 1.4MB is the maximum size of a XML file that QTP 6.5 can handle How to add a runtime parameter to a datasheet? 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") How to change the run-time value of a property for an object? 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 How to retrieve the property of an object? using "GetRoProperty". How to open any application during Scripting? SystemUtil , object used to open and close applications and processes during a run session. 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 ) How to covert a String to an integer? CInt()---> a conversion function available. Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why? Inserting a call to action will only Import the columns of the Action called Differentiate the two Object Repository Types of QTP? Per Action: For Each Action, one Object Repository is created. Shared: One Object Repository is used by entire application. Have you ever written a compiled module? If yes tell me about some of the functions that you wrote? I Used the functions for Capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them? pbs :WR fails to identify the object in gui. If there is a non std window obk wr cannot recognize it ,we use GUI SPY for that to handle such situation. Can you do more than just capture and playback? I have done Dynamically capturing the objects during runtime in which no recording, no playback and no use of repository is done AT ALL. It was done by the windows scripting using the DOM(Document Object Model) of the windows.

PRABU M

[email protected]

Page: 1

Explain the terms Password Encoder, Remote Agent, Test Batch Runner, Test Results Deletion tool? Password Encoder—enables you to encode passwords. You can use the resulting strings as method arguments or Data Table parameter values. Remote Agent—determines how QuickTest behaves when a test or component is run by a remote application such as Quality Center. Test Batch Runner—enables you to set up QuickTest to run several tests in succession. Test Results Deletion Tool—enables you to delete unwanted or obsolete results from your system according to specific criteria that you define. What is the file extension of the code file & object repository file in QTP? 

For code file the extension is .vbs



For object repository file the extension is .tsr



File extension for per action is (.mtr)

How to Merge Object repositories? With QTP 8.2, there is QTP Plus setup. It provides Repositories Merge Utility. The Object Repository Merge Utility enables user to merge Object repository files into a single Object repository file. What are the different scripting languages you could use when working with QTP? Visual Basic (VB), XML, JavaScript, Java, HTML How can we write scripts without having GUI (means u doesn’t have any GUI and u want to write a script in QTP)? By descriptive programming What is the descriptive programming? What is the use of descriptive programming? QTP uses its object repository to refer to objects present in your test and which have been recorded, if you wish to use objects that were not recorded and are not present in your object repository then we use descriptive programming, where QTP does not refer to object repository but the property name and value are mentioned in the code itself. In one of my interviews, I was asked to Write a paragaraph explaining how much scripting I did in QTP? I don't know where to start and what to write. So I need your help in writing that. I think in order to test your skills in QTP they must have asked like that.You must have taken one screen in your project and must have written Script for that.For Example I think you are familiar with Login page which has the username and password textfields with Login Button.

PRABU M

[email protected]

Page: 1

1st answer Step1: Open QTP and load the Webaddins and VB addins if required. In New test, First Learn the Objects "Username textfield,Password textfield,Login button" of that Login page using "Add object" Concept in "Object Repository" and adds the objects information to the objectRepository. Step2: Go to Expert view and then start writing the Script as Browser("Login").Page("Login").WebEdit ("username").Set "username" --- 1 ---This script enters the data "username" into the username field by placing the cursor to the username field which is in the page "Login" of Browser "Login" Browser("Login").Page("Login").WebEdit ("username").SetSecure "password" –2 --- this script enters the data "password " in secure format in the password field by placing the cursor to the password field which is in the page "Login" of Browser "Login".Browser("Login").Page("Login").WebButton("Login").Click ---this script clicks on the Login button by placing the cursor on the Login button which is in the page "Login" of Browser "Login. This is how you need to explain the script what you have written. 2nd answer You can tell them that you have used some "Condition Statements" to check the records in your database. IF Condition THEN Reporter.reportevent "-------" END IF 3rd answer 1# Scripting in QTP is about working in expert view. 2# Creating User defined Functions using VB Scripts. 3# Using Conditional loops. 4# Manipulating with Functions, Test objects and Utilities. 5# Creating Libraries, creating startup script, creating init script. Automation Frameworks using QTP Frame work is a set of defined rules for automating a testing process. There are 4 types of frame works in QTP 1.Linear frame work- recording and play back. 2. Modular frame work- creating scripts as a user defined function and calling that for test cases. 3. Keyword driven frame work- make changes in the keyword view of QTP and it’ll create scripts in script view. 4. Hybrid frame work- combination of any of above (it depends on complexity of scenario). 1. Linear framework- this is normal process like recording or scripting the program and executing it. This is not reusable, once executing this script. 2. Modular framework- this is different from liner frame work, here recording or scripting the program and those script split into actions and make those actions as reusable actions. These reusable actions can use any where in the test. 3. Keyword driven automation framework- QTP supports to keyword driven automation framework. It's an application independent Automation Framework, this Framework will have following components: 1) Data tables /Excel Sheets containing Keywords, Object Names and Object Values. This is the only component which is application dependent. Keywords are the words that we used to represent the test case. For example VerifyEditbox. This can be used to represent the test case: Verify whether the Edit box is accepting the entered text. 2) Test Driver. This contains the scripts to drive the test. Usually it will contain the code for taking keywords one by one from the data table and call respective subroutines for each keyword using the Switch case statement. 3) Common Function Library. This contains all the common functions that are needed to test any application. 4. Hybrid frame work- combination of any of above (it depends on complexity of scenario).

PRABU M

[email protected]

Page: 1

Related Documents