Sunday 30 August 2015

QTP INTERVIEW QUESTIONS

QTP - Interview Questions: Part 4:


Q. 1: What are the Environment Variables?
===================================
Environment variables are global variables available to all Actions
# They can be used to run a test case on different environment
# To add a new Environment variable go to Test -> Settings...->Environment (Tab)
# Environment variables are of two type:
1. Built in environment variables: Provide information about the system and the current test
2. User-Defined environment variables: are added in the Environment tab of Test Settings. These are Read-only during the test run
============================================
Q. 2: How many types of Parameters are there in QTP?
============================================
There are two types of parameters:
1. Test parameters:
# These can be set in Test->Settings...->Parameters (Tab)
# Test parameters value can be provided when replaying the test
# Test arguments can be accessed in the test using TestArgs("")
2. Action parameters :
# Used to pass parameters to Action
# Output parameters can only be used when Action is being called for a single iteration
# Ex - RunAction "Login", oneIteration, "TestUser", "TestPass", out
# A parameter can be accessed using Parameter("ParamName")
================================
Q. 3: What is Descriptive Programming?
================================
Descriptive Programming is an alternate way of writing test cases without having objects in object repository
Descriptive programming can be done in two ways
1. Using Object description
2. Using String description
In Descriptive programming objects are identified by describing all the identification properties
===================================================
Q. 4: After creating the test, what is the purpose of runing them?
===================================================
1) To check your application: The test starts running from the first line in your test and stops at the end of the test. While running, QTP connects to your application and performs each operation in your test, including any checkpoints, such as checking any text strings, objects, tables, and so forth. If you parameterized your test with Data Table parameters, QTP repeats the test (or specific actions in your test) for each set of data values you defined.
2) To debug your application: You can control your run session to help you identify and eliminate defects in your test. You can use the Step Into, Step Over, and Step Out commands to run your test step by step. You can begin your run session from a specific step in your test, or run the test until a specific step is reached. You can also set breakpoints to pause your test at predetermined points. You can view the value of variables in your test each time it stops at a breakpoint in the Debug Viewer.
3) To update your application: You can run your test using Update Run Mode to update the property sets used for test object descriptions, the expected checkpoint values, the data available to retrieve in output values, and/or the Active Screen images and values.
You can run your test using Maintenance Run Mode when you know that your application has changed, and you therefore expect that QTP will not be able to identify the objects in your test. When you run tests in Maintenance Run Mode, a wizard opens for steps that fail because an object could not be found in the application. The wizard then guides you through the steps of resolving the issue, and, after you resolve the issue, the run continues.
==========================================
Q. 5: What are the main stages of Testing with QTP?
==========================================
Testing with QuickTest involves the following main stages:
1) Planning
2) Creating Tests
3) Running Tests
4) Analysing Results
===========================================
Q. 6 : How can we do the Analysis of Results in QTP?
===========================================
After you run your test, you can view the results.
# View the results in the Test Results window: After you run your test, you can view the results of the run in the Test Results window. You can view a summary of your results as well as a detailed report. If you captured still images or movies of your application during therun, you can view these from the Test Results window.
# Report defects detected during a run session: If you have access to Quality Center, the HP centralized quality solution, you can report the defects you discover to the project database. You can instruct QTP to automatically report each failed step in your test, oryou can report them manually from the Test Results window.
================================
Q. 7: What is Business Process Testing?
================================
# Business Process Testing is a role-based testing model that enables Subject Matter Experts-who understand the various parts of the application being tested-to create business process tests in Quality Center. Automation Engineers-who are experts in QTP and automated testing-use QTP to define all of the resources and settings required to create business process tests.
# Business Process Testing uses a keyword-driven methodology for testing, based on the creation and implementation of business components and business process tests. A business component is an easily-maintained, reusable unit comprising one or more steps that perform a specific task within an application.
============================================
Q. 8: What are Permissions Required to Run QuickTest Professional?
============================================
You must have the following file system permissions:
1) Full read and write permissions for all the files and folders under the folder in which QTP is installed
2) Full read and write permissions to the Temp folder
3) Read permissions to the Windows folder and to the System folder
You must have the following registry key permissions:
1) Full read and write permissions to all the keys under HKEY_CURRENT_USER\Software\Mercury Interactive
2) Read and Query Value permissions to all the HKEY_LOCAL_MACHINE and HKEY_CLASSES_ROOT keys
======================================
Q. 9: What is the role of Keyword view in QTP?
======================================
The Keyword View enables you to create and view the steps of your test in a keyword-driven, modular, table format. The Keyword View is comprised of a table-like view, in which each step is a separate row in the table, and each column represents different parts of the steps. You can modify the columns displayed to suit your requirements.
You create and modify tests by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as you complete it, enabling you to view a description of your test steps in understandable English.
Each operation performed on your application during a recording session is recorded as a row in the Keyword View.
====================================
Q. 10: What is the role of Expert view in QTP?
====================================
In the Expert View, QTP displays each operation performed on your application in the form of a script, comprised of VBScript statements. The Expert View is a script editor with many script editing capabilities. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View

Q. 11: Where can we use a Function or an Action?
========================================
It all depends on the scenario.
If you want to use the OR feature then you have to go for Action only. If the functionality is not about any automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of using function/action depends on what any one would be comfortable using in a given situation.
===================================================
Q. 12: What is the difference between an Action and a Function?
===================================================
Action is a activity specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository associated with it while a function can't. A function is just lines of code with some / none parameters and a single return value while an action can have more than one output parameters.
================================================
Q. 13: What are the various events available in the Recovery Scenario Manager?
================================================
1) Application Crash: This event is useful in handling crashed applications at runtime.
2) Pop Up Window: This event is useful in managing various unwanted application windows, which get built-up at runtime.
3) Test Run Error: This event is useful in handling VBScript statement errors at runtime.
4) Object State: This event is useful in handling object related errors at runtime.
=========================================
Q. 14: What are the Elements of Recovery Scenario?
=========================================
Steps to handle the exceptions are
1) Trigger Event: Is an unexpected event like appearance of a Pop-up window, object state, test run error causing application crash or interruption in our running session.
2) Recovery Steps: Constitutes a series of steps required to be performed to enable QTP to proceed further with the process of test after some trigger event has interrupted the run session. Examples of a recovery operation can be 1) A keyboard or mouse Operation like a Click over the "OK" button in the Pop-up window 2) Close Application Process 3) Function Call 4) Restarting the OS etc.
3) Post-Recovery Test Run: Are a set of instructions designed to be provided to QTP on proceeding further with the test after some recovery operation has been carried out. Examples of Post Recovery actions can be repeating the complete test from the beginning or some steps may be skipped altogether & continuing with the remaining steps in the test.
=====================================================
Q. 15: When to use a Recovery Scenario and When to use "on error resume next"?
=====================================================
Recovery scenarios are useful when it is difficult to predict at which step the errors can come or when we are confident that the error will not come in the QTP script, whereas it can be anywhere outside the QTP Script. For illustration; Pop-up message of "out of paper", as caused by the printer device driver. "On error resume next" is preferred when we sure that the error is expected one and wish to perform some other actions.
=========================================
Q. 16: What are the key features of QTP at a glance:
=========================================
# Ease of use: QTP allows even novice testers to become productive in minutes. You can create a test script by simply pressing a Record button and using an application to perform a typical business process. Each step in the business process is automated documented with a plain-English sentence and screen shot. Users can easily modify, remove, or rearrange test steps in the Keyword View.
# Simple interface: QTP is much simpler to understand. It presents a test case as a simple business workflow to the tester.
# Simple Language: QTP uses Microsoft's VBScript for its test procedures, and to manipulate the objects and controls of the application under test. VBScript is a real programming language where several existing functions & resources are easily available for implementation these days.
# Use of zero-configuration Technology: QTP uses next-generation "zero-configuration" Keyword Driven testing technology. This helps in faster test creation, easier maintenance, and provides more powerful data-driving capability.
# Automatic insertion of checkpoints: QTP enables thorough validation of applications through a full complement of checkpoints. QTP can automatically introduce checkpoints to verify application properties and functionality, for example to validate output or check link validity.
# Marvelous interface with Data-tables: QTP allows entry of 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. QTP has better and easier to use Data table integration compared to WinRunner.
# Better object identification mechanism: QTP Identifies objects with Unique Smart Object Recognition, even if objects change from build to build, thereby enabling reliable unattended script execution.
# Support of variety of environment: QTP supports functional testing of all popular environments, like Windows, Web, .Net, Visual Basic, ActiveX, Java, SAP, Siebel, Oracle, PeopleSoft, terminal emulators, and Web services.
# Easy adaptability of Microsoft Object Models: QTP can easily create and implement Microsoft Object Model like: Outlook objects, ADO objects, FileSystem objects, supports DOM, WSH, etc.
# Auto-documentation technology: QTP renders test documentation and test creation to a single step with the help of its auto-documentation technology
=================================================
Q. 17: What are various types of properties when using object identification in QTP?
=================================================
QTP uses three types of properties when identifying a object
1. Mandatory Properties - Always learn these properties for the object
2. Assistive Properties - Learn in case Mandatory properties are not enough to identify the object uniquely
3. Ordinal identifiers - Learn in case both mandatory and assistive properties are not able to recognize the objects correctly
=====================================================
Q. 18: What are the various ways to insert a Action in a test in QTP?
=====================================================
There are three ways to insert a Action in a test
1. Insert Call to New...
2. Insert Call to Copy...
3. Insert Call to Existing...
========================================
Q. 19: What is the use of Parameterization in QTP?
========================================
Parameterization is helpful in following aspects.# Parameterization allows us to pick different values at run time.
# Reduces Time and Effort.
# Usage of data drivers allows us to use the same data for various input boxes.
# Parameterization can also be done for checkpoints.
=============================
Q. 20: What are Data Tables in QTP?
=============================
Data Table is MS Excel like spreadsheet which can be used for parameterizing a test case
DataTable are of two types:
1. Global Data Table - Data table for Test flow
2. Local data table - Data table for every action

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.