QTP Interview Questions

Ratings:
(4.6)
Views:2740
Banner-Img
  • Share this blog:

QTP Interview Questions

Q1) What is QTP’s model for test creation?

Ans: Determine testing needs – Define testing environment, Analyse your application and plan actions Set up repositories – Local or Shared OR Define function libraries Generate test steps – Add steps, Add checkpoints Data drive your tests Run the tests

Q2) Does QTP run in any environment?

Ans: No, QTP works only in the Windows environment.

Q3) Explain the views in the QTP GUI.

Ans:

Keyword view:

This view is a tabular representation of all the objects and the actions that are performed on them. Every row in the table is a step performed on the AUT and can be modified. Some of the most common columns displayed are item, operation, value and documentation.

Expert view:

As the name indicates, this view is for more technical users who would want to tweak the source code as per their requirements.

Q4) What are the different kinds of test steps?

Ans: 5 types of steps : Test Object ( Performs actions on a TO) – Functions – Utility (Steps to control run session. Eg: Reporter. report) – Comment – Programming logic (Loop, conditions…etc)

Q5) What phases are involved in testing an application in QTP?

Ans: The Quick Test Professional process consists of the following main phases:

Analyzing Application: before preparing test cases need to analyze the application to find out the testing needs.

Preparing Testing Infrastructure: based on testing needs create those resources, resources like, shared repository, function library etc.

Building Test Cases: create test script containing action to be performed while testing. Add object repository with the test function libraries.

Enhancing Test: by making use of checkpoints, broadening the scope of test, add logic and condition to test for checking purpose.

Debugging, Running and Analyzing Test: debug the test so that it works without interruption. Run these test and analyze the test result generated by QTP

Report Defects: lock bug into the bug report and send it to the development team.

Q6) How many types of recording modes in the QTP?

Ans: The QTP enable us with three types of recording mode:

Normal (by Default recording): In this recording mode QTP identify the object irrespective of their location on the screen. It is done by recording object based on application window.

Analog Recording: It is used when exact mouse movement and action performed by mouse is important. Used in testing the paint application and signature made with the help of mouse.

Low Level Recording: It helps in identifying those objects which is not recognized by the QTP. It is used when the location of object is changing inside the screen.

Q7) What is an object repository?

Ans:

Object Repository:

When QTP learn any object from application it stores those object in the Object Repository with the properties of the object. It is used to identify the object. There are two types of object repository:

Shared Object Repository:

It can be shared between multiple tests but it does not allow making changes in the repository. Mostly used in Keyword Driven methodology. It is saved with .TSR extension.

Local Object Repository:

This type of object repository is linked with only one test. In this we can perform change in the repository, like changing the properties of the object, adding object in the repository. It is saved with .MTR extension.

Q8) Explain step generator in QTP?

Ans: Step Generator in QTP helps in creating those steps which is performed over the object while testing. Use of Step Generator in QTP:

  • Help in debugging the script by making use of Break.
  • To add those step which we forget to perform while recording.
  • To ensure that objects exist in the repository
  • To add up step in the function library.

Q9) Explain the use of Action Split in QTP.

Ans: Action Split: It is used to split the action into two parts. There are two type of split an action:

Splitting into two sibling actions: Both split actions are independent of each other.

Splitting into Parent-Child nested action: In this second split action is only called after the execution of the parent split action. Child split action depends upon the parent split action.

QTP generated the duplicate copy of the object repository when we perform the Split action. We can add object to anyone spilt action which is not added into another split action’s repository.

Q10) What is the purpose of loading QTP Add-Ins?

Ans: Add-Ins: these are small programs or files which can be added to a computer in order to enhance the capabilities of the system. The purposes of loading Add-Ins into QTP are following:

  • To increase the capabilities of the system.
  • To improve the graphics quality, communications interface.
  • To load the particular function into the memory.
  • To excess only those functions that is required for the execution of the script.
Interested in mastering QTP Training? Enroll now for FREE demo on QTP Training.

Q11) What is a data-driven test in QTP?

Ans: Data-Driven is an automation testing part in which test input or output values, these values are read from data files. It is performed when the values are changing by the time. The different data files may include data pools. The data is then loaded into variables in recorded or manually coded scripts. In QTP to perform the data to drive the test, we use the parameterization process. When we do data-driven test, we perform two extra steps:

  • Converting the test to a data-driven test.
  • Creating a corresponding data table.

Q12) How to use Parameterization in QTP?

Ans: It is the process of making use of different values in place of recorded values which is replaced by variable which contains different values that can be used during the execution of the scripts. QTP enable us with different type of Parameterization, passing of data:

  • Using Loop statement.
  • Dynamically test data submission
  • Using data table.
  • Fetching data from external files.
  • Fetching data from databases.
  • By taking test data front end(GUI)

Q13) Is it possible to call from one action to another action in QTP?

Ans: Yes, QTP enables us to call from one action to another action. There are two ways of calling action:

Call to Copy of action: in this, we generate the copy of action in our repository which enables us to perform changes to the copy of action.

Call to Existing action: we call to action which is made up earlier. This generates the reference to the action. We can access the action in read-only mode. In this, no copy of the existing script and data table is made.

Q14) Explain different types of action in QTP.

Ans: When generating the test script, it includes only one action. Action contains the number of steps to be performed on the application to test the application.

There are three types of action in QTP:

1. Non-Reusable action: it can be called by test only once in which it is stored.

2. Reusable action: it can be called by test multiple times in which it is stored.

3. External action: it is reusable action but stored in an external test. We can call external action but it will be available in read-only mode we cannot perform any change to the External Action.

Q15) What are the advantages of test automation?

Ans:

  • Time – It produces quick results
  • No Manual intervention
  • Cost-effective
  • Not prone to human errors

Q16) If the object hierarchy is changing from build to build, then how you will handle that condition?

Ans: In this case, descriptive programming can be used instead of having an OR. Even while descriptive programming tries to use regular expressions to identify the unique property of the objects.

Q17) What is the difference between the Run time object and the Test object?

Ans: The difference between the Run time Object and the Test objects are:

  • Run time objects are actual objects in the application whereas test objects are references of the actual object.
  • Run time objects always have the same name whereas the test object name varies in a different environment.
  • Test objects are used to identify the actual object in the application which is run-time objects.
  • The run-time object resides in the application whereas the test object resides in the object repository.

Q18) Explain Measuring Transaction.

Ans: Measuring transaction means that to measure how much time it takes to execute a set of step over the application. A transaction is a collection of steps that we are intended to know how much time it takes to execute. We can define the transaction by enclosing the set of steps with the start transaction and end transaction.

Start transaction: after the encounter of start transaction time measurement start. 

End transaction: it is used to stop the time measurement.

Q19) Explain different checkpoints in QTP.

Ans: Checkpoint is a point where QTP current value or property of the object with the expected value or property of the object. When we insert the checkpoint in the test, then in the keyword view checkpoint is added in front of the current row and in the expert view a checkpoint statement is added. QTP enable us with the following types of checkpoint:

Standard Checkpoint: check properties of objects like buttons, combo boxes, lists etc.

Image Checkpoint: check the value of an image

Bitmap Checkpoint: check image zooming capability.

Table Checkpoint: check information of a table.

Text Checkpoint: check text is displayed in the correct place.

Text Area Checkpoint: check text is displayed in a specific area.

Accessibility Checkpoint: used to determine a website that is not as per W3C guidelines.

Page Checkpoint: checks properties of the webpage.

Database Checkpoint: check the content of the database.

XML Checkpoint: check XML content.

Q20) Describe the Synchronization Point.

Ans: Synchronization Point: When the application response speed is not the same as the test execution speed this may cause an error. In order to remove this error we use Synchronization point. Synchronization is done by making a QTP test to wait until the application is ready for execution. When we insert the Synchronization point in the test then QTP generates the WaitProperty Statement in the ExpertView. For synchronization, we can use:

  • Exist statement
  • Wait statement.

Increase the defaulted time of QTP waits for the web page to load.

  • Change in default timeout setting.

Q21) What are the expert view and keyword view?

Ans:

Expert View: It contains the steps performed over the application in VBScript language.

Expert view enables us to edit the script.

In keyword view, a row exist for each object and method which is mentioned in Expert View.

Keyword View: contains the steps executed on the application in keyword-driven tabular form in the English language.

Keyword View contains four fields: ITEM, Operation, Value, and Document. 

By selecting items and operations we can create and modify tests.

Q22) What is Keyword Driven Framework?

Ans: In Keyword driven framework the QTP executed script which is written in the Excel sheet with the help of Driver Script. For making Keyword Driven Framework we have two ways:

Specify Script Values Directly in Excel

Write Global Functions to perform the action on the application as function keywords in Excel.

Q23) What are the benefits of QTP?

Ans: The benefits of QTP are:

  • Standalone tool and integrated with Quality Center.
  • Testing results stored in the database automatically can be used for analyzing system performance.
  • Supports Keyword driven testing.
  • QTP Identifies objects, even if they change from build to build.
  • By using QTP, Test execution time and cost will reduce.
  • Suitable for both client-server and web-based application
  • Better error handling mechanism
  • Excellent data-driven testing features

Q24) What are the disadvantages of recording test cases in QTP?

Ans: Following are the Disadvantage of recording test cases in QTP

  • Occupies lot of space results in reducing QTP performance.
  • Updating test is difficult.
  • Internal to the QTP, which may cause corrupted.

Q25) What are the expert view and keyword view?

Ans:

Expert View: It contains the steps performed over the application in VBScript language.

Expert view enables us to edit the script.

In keyword view, a row exists for each object and method which is mentioned in Expert View.

Keyword View: contains the steps executed on the application in keyword-driven tabular form in the English language.

Keyword View contains four fields: ITEM, Operation, Value, and Document.

Selecting items and operations we can create and modify tests.

Q26) What is the process of synchronizing QTP and AUT?

Ans: We can synchronize QTP and AUT by applying any one of the following methods:

  • Wait statement.
  • Using exit statement
  • Synchronization point.
  • Increasing timeout. ( tool default synchronization point)
  • Syn (synchronize method) method

Q27) What is the difference between design time and runtime data table?

Ans: The differences between the Design time and Run timetable are:

  • Design time tables are visible in QTP main test but Run time table is visible in Test Result Window.
  • Design time table is created before the execution of test whereas Run time table is created after execution of test.
  • Design time table referred to the external data but Run time table represent actual design table in the application.

Q28) What is the difference between Shared and Local Object Repositories?

Ans: The difference between Shared and Local Object Repository are:

Shared OR can be shared between multiple tests whereas Local OR can only link with one test.

Shared OR does not allow making changes in the repository but Local OR enables the tester to perform the change in the object property present in the Object Repository or add an object in OR.

Mostly used in Keyword Driven methodology. It is saved with.TSR extension where as Local OR is saved with.MTR extension.

Q29) What are the shot cut keys for the following?

Ans:

  • Normal Recording:
  • F3 Run the test script:
  • F5 To stop the recording:
  • F4 For Analog Recording:
  • Ctrl+Shift+F4 Low Level Recording:
  • Ctrl+Shift+F3 To switch between Tree View and Expert View:
  • Ctrl+Tab

Q30) What is the recovery scenario in QTP?

Ans: While executing a test, some unexpected errors and events may occur.

To overcome this we take the help of Recovery Scenario.

The Recovery Scenario Consist of the Following:

Trigger Event: when unexpected events or errors invoke.

Recovery Operation: Operation needed to perform for running the remaining test script.

Post-Recovery Test Run Option: after recovering from an unexpected error where to start the remaining test execution

Q31) What are the steps involved in Recovery Scenario Wizard?

Ans: The Recovery Scenario Wizard consists of the following steps:

  • Defining of a trigger event.
  • Defining Recovery operation.
  • Selection of Post Recovery Run.
  • Specifying either to associate recovery scenario to the current test or all-new test.

Q32) Explain different types of event trigger options.

Ans: In QTP, there are the following types of triggers:

1. POP-UP window: QTP identifies the POP-UP window based on the window title and textual content.

2. Object State: object state is identified by its properties.

3. Test Run Error: when the test run result value is failed it is identified.

4. Application Crash: this state is identified by a predefined list of applications.

Q33) What are the different types of Recovery Operations?

Ans: The following type of Recovery Operation is available in QTP:

  • Keyboard or mouse operation.
  • Close Application Process.
  • Function call.
  • Restart Microsoft Windows.

Q34) Describe the Function Procedure in VBScript.

Ans:

Function procedure: it consists of steps of statements written in VBScript with some return value.

  • A function statement is used to declare a name, argument and code.
  • When no argument is given it takes empty parentheses ().
  • Name is used to return the value.

SYNTAX of Function Procedure:

[Public][Default][Private] Function name [(arglist)] [Statements]

[name = expression] [Exit Function] [Statements] [name = expression]

End Function

Q35) How to handle Java tree in QTP?

Ans: You will need to select and load the Java Add-in. Then you can record and work on a Java Tree object just like you would with any other object.

Q36) How to give a call to another action from one action?

Ans: Calling one action from the other can be done by “Inserting a call” to an existing action or by creating a new action. Please refer to tutorial #21 for a detailed explanation.

Q37) How to find Operating system information using the QTP script?

Ans: You can do that with the help of the environment variable. The exact variable is, OS and OS Version is for the version information.

Q38) How you can identify the browser and its information using the QTP script?

Ans: You can identify and act on any browser that you opened again by referring to its ‘creation time’ property and use it like you would with a browser object in your OR.

Q39) How are actions and functions different in QTP?

Ans: Actions have their own Datatables and OR, but functions don’t. More importantly, Functions are a VB Scripting element, not only applicable to QTP. Please refer article 21 a detailed explanation of these.

Q40) How to remove the associated Function library?

Ans: To remove the associated Function Library we can perform any one of the following methods:

METHOD 1:

  • Select Resource Pane.
  • Right-click on the function library, and select Remove Function Library.

METHOD 2:

  • Select Resource Pane,
  • Select Function Library.
  • Press the DELETE key.

METHOD 3:

  • Go to the list of Associated Function Library in the Resource Pane.
  • Select the Function and click the Remove button.

Q41) What is reusable action?

Ans: An action that can be called multiple times within or outside the same test is called reusable action. By default all actions are reusable.

Q42) What are the different attributes used with Regular Expression?

Ans: The different attributes of Regular Expression are:

Backslash(\): when it is encountered the next character is treated as a literal character.

Period(.): is used to search any single character.

Square Bracket[ ]: is used to search for a single character within a list of characters.

Caret(^): is used to match any character in the list except those specified in the string.

Asterisk(*): to match zero or all occurrences of the preceding characters.

Q43) What is the difference between Global and the action sheet in QTP?

Ans:

Global Sheet: Globally accessible by all tests. Used when we have to perform many actions by using a single script.

Action Sheet: Locally accessible in a test. It is used when only one action is performed with one script.

Q44) Explain XML Checkpoints.

Ans: XML Checkpoints are used for the verification of the current and expect value or properties of the XML documents. A checkpoint fails when actual and expected values or properties are not same.

QTP enables us with three types of XML Checkpoints:

  1. XML Web Page or Frame Checkpoints.
  2. XML File Checkpoints.
  3. XML Test Object Checkpoints.

Q45) How to modify the Text Checkpoint?

Ans: To modify the Checkpoint in QTP we do the following:

  • Go to Keyword View, Right-Click the Checkpoint.
  • Select Checkpoint Properties.
  • Checkpoint properties dialog box open, change the setting.

Q46) Give the Syntax to load Function at run time.

Ans: Syntax to load the function at run time:

LoadFunctionLibrary strCurrentLibPath + “DialogCrashChecks.qfl”, strCurrentLibPath + “DialogL18nChecks.qfl”

Q47) What is the use of an Ordinal identifier in QTP?

Ans: Ordinal Identifiers are used to initialize the value to the object which is in numeric form and it is used to find out its order with respect to other objects.

QTP enable us with the following types of Ordinal Identifiers:

Index: indicates the order of objects.

Location: determine the location of the object like inside the parent window, frame or dialog box relative to other objects.

Creation Time: determine the order in which the web browser opens.

Q48) How to delete an object from the Object Repository?

To delete an object from the repository:

  • Go to repository tree, and select the object.
  • Click the Delete button or select Edit> Delete.
  • Click Yes to confirm.

Q49) What is Cross-Site Scripting?

Ans: Cross Site Scripting is a thread in the dynamic website. It is also known as XSS. Cross-site scripting occurs when a web application gathers malicious data from a user. The data is collected in the hyperlink form which contains malicious content within it. It allows malicious code to be inserted into the web page. The web page can be a simple HTML code or a client-side script. When the malicious code is inserted into a page and clicked by some user, the malicious code becomes a part of the web request of the user. This request can also execute on the user’s computer and steal information.

Q50) What is contained in the Object Repository?

Ans: The object Repository stores the element identification properties extracted from the application during recording. ID will be generated for each element and this ID is used for Object identification in the application. The object Repository acts as a repository for the application elements. Object Repository contains two properties of each object for identification:

  • Physical properties description of the object
  • Logical name of the object.

Q51) The hybrid framework supports Descriptive programming. Is it true?

Ans: Yes. Frameworks are mostly based on how and where you want your test assets to be placed and how they are to be accessed for maximum efficiency. They do not restrict how you write you test itself.

Q52) What are the advantages of the Hybrid framework?

Ans: The hybrid framework is nothing but a combination of frameworks that make you arrive at a solution for your testing needs by taking what works best for your scenario. The obvious advantage is the versatility. It can be tailored to meet any testing project’s needs.

Q53) What is Procedure or Subroutine in VBScript?

Ans: Sub procedure is a series of VB Script statements (enclosed by Sub and End Sub statements) that perform actions but don’t return a value. A Sub procedure can take arguments (constants, variables, or expressions that are passed by a calling procedure). If a Subprocedure has no arguments, its Sub statement must include an empty set of parentheses ().

Q54) Is VBScript Case sensitive or Case insensitive?

Ans: It is not case-sensitive with respect to command and variable names. Everything else, like strings (text), is.

Q55) What is the difference between the keyword view and the expert view?

Ans: They are two ways QTP shows your test. Each one has its own features and caters to users of different levels of expertise.

Keyword view: This is a tabular representation of your test that has information like the Item, Operation, Data and Comments.

Expert view: This displays your test in terms of the actual lines of code. It is more like a VB Script editor and is used by advanced users.

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox