Overview

Overview

Welcome to QTP interview questions

Hello software Quality engineers. Welcome to our Software testing world and common QTP(Quick test pro) related technical issues, interview questions etc. . Over 2 years, I am trying to update all possible interview questions in testing area of QTP. With your continuous comments on the topics and suggestions, we are growing day by day.

Wednesday, December 19, 2007

. Changing D Mic.ini file

Some of QuickTest Professional information is stored in a text file which is called mic.ini. tis file is located under D QuickTest bin directory.[SectionA]NameA=ValueA
To enter D above change 2 D mic.ini file U should perform D following:
1. Open D mic.ini file located under D QuickTest Professional bin directory using any standard text editor
2. Search 4 section name (in tis case 'SectionA'). If it does not exists - add it 2 D end of D file
3. If D line (beginning with D NameA text) exists in D section, Dn change D value 2 be ValueA
4. If D line does not exist add it 2 D end of tis section (before D next Section begins)

How 2 change D logical name of a Test Object?

When recording an object QuickTest Professional uses one of D object's properties as D logical name 4 D object (the name displayed in D Expert View and in D KeywardView modes).
U can change D property that is used 2 be a different one bi specifying which property's value U want 2 use as D logical name 4 D object.
For example in order 2 use D alt property as D logical name of an image, run regedit.exe and set D following information:[HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\Test Objects\Image]
"tag query name"="alt"

How 2 remove result files 4m old tests?

U can use D Test Results Deletion 2ol 2 view a list of all D test results in a specific location in Ur file system or in a Quality Center project. U can Dn delete any test results that U no longer require.
The Test Results Deletion 2ol enables U 2 sort D test results bi name, date, size, and more, so that U can easily identify D results U want 2 delete.
U can find tis utility in D Start Menu > QuickTest Professional > 2ols > Test Results Deletion 2ol.

. How do I make D test prompt D user 4 input while it is running?

The VBScript InputBox function allows U 2 display a dialog box that prompts D user 4 input and Dn continue running D test. U can use D value that was entered bi D user later on in D test. See D VBScript reference manual 4 more information on D InputBox function.
The following example shows D InputBox function used 2 prompt D user 4 D password.Browser("Mercury 2urs").Page("Mercury 2urs").WebEdit("username").Set "administrator"
Passwd = inputbox ("Enter password", "User Input")
Browser("Mercury 2urs").Page("Mercury 2urs").WebEdit("password").Set Passwd

How do I add a manual wait step 2 my test?

A manual wait (think time) can be added 2 a QuickTest test using D following command:Call Wait(

I have a Microsoft Access database that contains data I would like 2 use in my test. How do I do tis?

The powerful 'Expert View' allows U 2 access databases using ADO and ODBC. Below is a sample test that uses D information contained in D Authors table of a database 2 search 4 books written bi D author.Dim MyDB
Dim MyEng
Set MyEng = CreateObject("DAO.DBEngine.35")
Dim Td
Dim rs
' Specify D database 2 use
Set MyDB = MyEng.OpenDatabase("BIBLIO.MDB")
' Read and use D name of D first 10 authors
Set Td = MyDB.TableDefs("Authors")
Set rs = Td.OpenRecordset
rs.MoveFirst
For i = 1 2 10
Browser("Book Club").Page("Search Books").WebEdit("Author Name").Set rs("Author")
Browser("Book Club").Page("Search Books").WebButton("Search").Click
Next

What command-line arguments can I use when launching QuickTest?

Please refer 2 D QuickTest Command Line utility 4 more information on how 2 run QuickTest using a command line.

Does QuickTest have any debugging capabilities?

In order 2 debug tests U must install D Microsoft Script Debugger. If U did not download and installed it while installing QuickTest, D debugger can be still downloaded 4m D Microsoft Script Technologies site. After downloading it, double-click on D self-extracting executable and follow D instructions on Ur screen.
Once D Script Debugger is installed, an arrow points 2 D current step that is being executed in D Tree View and D Expert View. U can Dn use D debugger 2 view local action variables, use D command window, view D objects properties, and more.
More information can be found in D QuickTest User's Guide.

How 2 use Environment variable?

QuickTest supports using environment variables. Environment variables can be either system variables or user defined variables.
U can define D user defined variables in an external file which will be read bi QuickTest when it will be launched.
See D Using Environment Variables section in D QuickTest Professional help.

How 2 configure D report 2 show only error (by default)?

U can configure D report 2 show only error bi default bi adding D following section 2 D QTReport.ini file (located under QTP bin directory).[FilterDialog]ReportAppDefaultFilter=1 # 4 error onlyReportAppDefaultFilter=3 # shows all messages (default)

How 2 pass parameters when calling actions?

U can pass information between actions in several ways:
1. Using D new Action Parameters feature in Quick Test 8.0
2. Putting D variable in D data table and Dn accessing tis data table 4m D called action.
3. Defining D variable as an environment variable that can be accessed 4m D entire test.

How 2 create an action template?

U can create a template action script that will be used on every new action that is created. U can use tis, 4 example, 2 add a header comments 2 each action.
To create D template action U should create a text file with D name ActionTemplate.mst and place it under QTP dat folder.

Can I change D Active Screen page which is shown on every new test?

tis page can be changed 2 be any valid HTML page. D page can be located either locally or on D network.
For example, if U want Ur entire organization 2 view D same Active Screen page when Dy open QTP, U should open D NewTest.inf file located under D dat\snapshots directory of QTP and set D next line:FileName1=FileName1=\\mercury\public\MainPage.html

Testing activity measurements


qtp life cycle task list2


QTP Life cycle Task list


LIFECYCLE FOR DEVELOPMENT PROJECT


Roles - Responsibilities QTP- Testing


























STANDARD FOR LIFECYCLE REPRESENTATIONs

8.1 Lifecycle definitions will comprise the following:

- Model representation: A simple flow chart outlining the activities/tasks.
- Task list: A table containing a list of all the tasks/activities along with their entry criteria, validation requirements and exit criteria.
- Measurements: A table containing a list of measurements collected from the tasks/activities.
- Tailoring: Guidelines for tailoring the lifecycle for different situations.

8.2 Lifecycles for the following types of projects are currently defined in this procedure:

Development Project: The project involves creation of a new system or enhancement of an existing system whose requirements are usually outlined by a customer. Enhancements may include the addition of new features and requirements or a subset of the development activities such as testing existing features and requirements thoroughly.
- Product development : The project involves creation of a new off-the-shelf product or enhancement of an existing off-the-shelf product. Enhancements may include addition of new features and requirements or a subset of the development activities such as testing existing features and requirements thoroughly.
- Iterative Model Product Development : This involves development of a new off-the-shelf product or enhancement of an existing off-the-shelf product on an iterative basis.
- Porting project : The project involves customising an off-the-shelf product to a specific, defined environment.
- Conversion project : The project involves converting a software system (entirely or partially), currently operating in a specific environment, in order to make the software operate in a different environment.
- Maintenance / product support project : The project involves customer-query handling and problem corrections to existing software in order to provide support to users of the software.
- Re-engineering project : The project involves refinement of existing software to meet current documentation, coding and other procedural standards.
- Lifecycle for small development project: The projects involves project/product development of or prototyping to the same using integrated project technical document.
- Testing Project: The project involves providing a complete test service for a developed project/product

8.3. The following conventions are used while representing the various lifecycles.
signifies that the task at the tail of the arrow must be completed before the task at the head of the arrow can commence

8.4 Process Performance model identifies the individuals responsible for monitoring various business objectives and inturn the process performance parameters

project plan - life cycle procedure

Responsibilities

6.1 For each project, the Project Manager identifies any variations from the Life Cycle described in this
document and also which phases of the life cycle are to be used for project control in their projects.

6.2 The Quality Manager approves and the General Manager authorises any deviations from this guideline.


7. Procedure

7.1. During project planning, the Project Manager decides on the appropriate lifecycle for the project by selecting from the various lifecycles described in this section .

7.2 The selected lifecycle for the project is then tailored to the project's needs based on:

- Tailoring criteria provided along with the lifecycle model
- Any requirements for the project specified by the customer
- Tailoring of organisation baselines based on new processes that will be piloted.

7.3 The lifecycle for the project is documented in the process handbook for the project.

7.4 The following terms are used while describing the various lifecycles:

- Business Requirements Specification (BRS) - the requirements to be met by the software such as functional, performance, interface and processing requirements are specified in detail.
- Functional Specification (FS) – the implementation aspects of the BRS such as the functional, performance, interface and processing requirements through business modelling, use cases, screen specifications and business rules.
- Design Specification
- High Level design - the system is broken down into individual components. The interfaces between the components are identified.
- Detailed Design - the behaviour and composition of each of the components is defined.
- Coding - the design is translated into code in an appropriate programming language.
- Unit Testing - each of the components is tested individually to verify that the component satisfies its goals, such as functional, performance and reliability goals.
- Integration Testing - every combination of components is tested to verify that the combination functions correctly as intended.
- System Testing - the system is built as a whole and tested to verify its conformance to the defined requirements.
- Release - the components of the software (including all documentation and information necessary to build the software) are assembled together for shipment.
- Acceptance - the activity of obtaining the customer's agreement that all the required deliverables meet their defined requirements.
- Specification of conversion - the various items to be converted - such as operating system calls, blocks of code specific to the older system, utility routines, etc are identified along with how they will be converted.
- Re-engineering specification - the software items to be created or modified in order to build a system that satisfies the requirements are identified, and the modifications to be made to these are identified.







7.5 Prototyping can be performed at any of these phases and need not conform to the structure as described in this document. However, all resulting code and/or design must undergo the life cycle steps and controls before it can be used in the product. The process such as the one for Rapid Development will have to be approved by the General Manager/Quality Manager before it can be used in a project. In addition, such a development can be taken up only if the contract/LOI allows it.

Handling overlapping of phases

This Lifecycle Procedure recognises that the phases mentioned in the previous sections may overlap due
to project schedule requirements. In such cases, the following guidelines are applicable:

- The Project Manager identifies the phase overlap as a risk in the project plan and lists the steps taken to counter these risks. These may include the steps outlined below.
- The Project Manager ensures that the inputs for an activity are available before the activity commences. (For example, design specifications for a module must be reviewed and approved when coding for the module commences although design of other modules might not be complete). The Project Manager also ensures that such inputs are under version control.
- When a change in an item requires a change in other items / activities for which this has been used as an input, the Project Manager confirms if the change is really necessary.
- If yes, the Project Manager ensures that revised versions / amendments of the item, along with detailed descriptions of the changes, are made available to personnel performing subsequent activities.
- The Project Manager also performs an impact analysis and revises the project schedules, if necessary. Such schedule changes are highlighted in the project status report. The Project Manager also ensures that sufficient review / testing of the changes is performed.

Testing abbreviations (terminology)

The following abbreviations are used while representing the various lifecycles.

Abbreviations
LOI
Letter Of Intent
WO
Work Order/TSOP
ATP
Acceptance Test Plan / Acceptance Test Planning
AT
Acceptance Test
STP
System Test Plan / System Test Planning
ST
System Test
ITP
Integration Test Plan / Integration Test Planning
IT
Integration Test
UTP
Unit Test Plan / Unit Test Planning
UT
Unit Test
BRS
Business Requirements Specification
FS
Functional Specification
DS
Design Specification
HLD
High Level Design
DD
Detailed Design

Fundamentals of testing

Fundamentals of Software Testing

Verification Testing
Verification is d process of examining a product 2 find its defects.
• Verification techniques include:
1. Desk checks
2. Peer reviews
3. Walk-throughs
4. Formal inspections
• Verification 2 ols include:
1. Standards
2. Checklists
3. Static analyzers
4. Use Cases
5. Judgment N experience
• d objectives of verification testing is 2 find defects
1. Using human examination N experience.
2. As early as possible in d life of d defect.
Inspection criteria:
1. If an input specification is used, it has been previously verified.
2. Special criteria can occur as a list of questions or a targeted checklist.
3. Inspection criteria is usually tied 2 d type of deliverable rather than d software product being developed. d typical 4 mal inspection assigns d following responsibilities:
Producer - have d product ready N available on time; work with d facilitator 2 establish N meet schedules; clarify issues 4 reviewers; resolve problems identified by d inspection team.
Facilitator - Learn d information being inspected; select d reviewers; schedule N
coordinate meetings; lead d discussion on d inspection issues N mediate disputes;
assign responsibilities; track each problem 2 closure.
Reader - Become familiar with d test subject; paraphrase d information into logical
'chunks'.
Reviewer - Learn d test subject N d inspection criteria; identify discrepancies between d two before d meeting; focus on identifying problems, not solving d m; remain objective; review d product, not d producer.
Recorder - Become familiar with d work product N d inspection criteria; record
accurately all issues raised by d review team.
Formal Inspection
• An inspection is a 4 mal review process that evaluates a test subject using:
1. A structured inspection process.
2. A set of inspection criteria or an input specification.
3. A meeting facilitator, a recorder, N an optional reader.
4. A trained inspection team of 3 2 6 reviewers.
5. Reviewer preparation.
6. A 4 mal report of findings, rework, N follow-up.

• Inspections apply a set of criteria 2 sections of a deliverable.
• d advantages of 4 mal inspections are
1. They are highly structured N require closure.
2. Success criteria are very visible.
3. They expose reviewers 2 d process N d deliverable.
• d disadvantages of 4 mal inspections are
1. They are very detailed N time-consuming.
2. Reviewers must be trained in inspection N product development.
3. The inspection criteria must be sound.
Walk-Through
• A walk-through evaluates a test subject by simulating (walking through) d process that it represents using simple test cases.For example
1. A code walk-through simulates d process of running an application using test data.
2. A requirements walk-through simulates user events being addressed in d way that d document specifies.
• d objective of a walk-through is 2 provide an interactive arena using d simulation as d basis 4 discussion.
• A walk-through consists of
1. The test subject (usually a document).
2. The producer who leads d review.
3. 3 - 5 reviewers, often subject matter experts.
4. An optional report of findings.
• Walk-throughs are very effective 4 evaluations that benefit 4m creative thought.
• d advantages of walk-throughs are:
1. They apply diverse expertise N promote creative evaluation.
2. They usually make defects easily visible 2 d producer.
• d disadvantages of walk-throughs are:
1. They are not structured.
2. They rely solely on reviewer expertise.
Peer Review
• A peer review is an evaluation of a deliverable done by a group of individuals who do d same kind of work.
• Peer reviews typically focus on specific aspects of d subject rather than d deliverable as a whole. 4 example:
1. A code review may address only programming efficiency N style.
2. A design review may focus on d accuracy of algorithms.
3. A requirements review may focus on testability.
• d advantages of a peer review are:
1. People generally learn N get motivation best 4m peers.
2. Diversity pays off, in terms of finding defects N learning 4m d m.
3. Peers become familiar with other deliverables.
4. Errors found in reviews cost less 2 fix than those found later.
• d disadvantages of a peer review are:
1. Reviews can be very taxing.
2. Peers may be uncomfortable critiquing each other's work.
3. The technique can cause resentment.
Desk Check
• A desk check is an evaluation of a deliverable by its producer.
• Desk checks are most commonly used by designers N programmers, but d y can also be used 4 other deliverables.
• d advantages of a desk check are:
1. The skills required 2 do a desk check are d same as those needed 2 develop d product.
2. The producer does d check so d re is no preparation time, no meetings 2 schedule, N no communication issues.
3. The desk check is a redundant check of d product's requirements.
• d disadvantages of a desk check are:
1. It is often difficult 4 an individual 2 identify defects in his or her own work.
2. It will probably NOT find any misinterpretations of d requirements or standards.
USE CASE OUTLINE
Transaction, Actors, Pre-Conditions, Inputs, Wrap up, Related Use Cases N Steps
Use Cases
• A use case is a 2 ol that defines a system requirement 4m an external (user) perspective.
• It defines an atomic business event as:
1. A set of one or more business conditions
2. A series of sequenced activities
3. A set of inputs
4. A set of one or more measurable outputs.
• d business conditions define d business event, d sources 4 d event, N d state of d system prior 2 d event.
• d series of activities describe d steps taken by d user 2 accomplish d business event.
• d set of inputs defines d data entered into d system 2 accomplish d event.
• d set of one or more measurable outputs describes d transactions performed by d systems N d behaviors that d system must support.
• Use cases are used in many different ways during system development.
1. Designers use this 2 ol 2 remove ambiguity 4m models of system functionality, behavior, N interfaces.
2. Testers use this 2 ol 2 explore software requirements 2 verify d m using atomic business events.
If you verify nothing else in d entire system, DO verify d requirements!
Sample Requirements Checklist
1. Ambiguous (Do requirements contain words that can be misinterpreted by readers? Are complex subjects displayed graphically? Are assumptions stated explicitly? Do we know who/what is doing d acting at all times?)
2. Inconsistent (Do d y support d objectives of preceding phases?)
3. Contradictory (Does any requirement disagree with d statements, measures, or
intention of any other requirement?)
4. Incomplete (Are all user N system objectives clearly specified? Do d requirements
define all d information displayed 2 d user? Do d y address all error conditions N
required responses? Data integrity mechanisms? Transaction authorization? Precision of
calculations? System maintenance requirements? Recovery N reconstruction? etc.)
5. Achievable (Can each requirement be met? Can each be sustained 4 d life of d
product? Are d se requirements feasible given d project constraints?)
6. Measurable (Is each requirement quantified N measurable?)
7. Traceable (Are d requirements arranged in such a way that d y can be used as a
source 4 all subsequent software products?)
8. Changeable (Can d se requirements be maintained d way that d y are written?)
Suggestion: When reviewing requirements, watch out 4 statements that contain adjectives N adverbs rather than measurable items. 4 example, compare:
- “The system must be VERY fast under all normal circumstances.” OR
- “The system must deliver 3 second response time 2 ad hoc queries N 1 second
response time 2 pre-defined queries. Response time refers 2 d period of time
between d start of a query N d appearance of d last line of output.”
Verifying Requirements
• When we verify requirements we are checking that:
1. we understand d users' needs before design begins.
2. we can effectively evaluate d product in terms of d se needs.
• It is critical 2 verify d requirements document 4 several reasons:
1. This is d document that records d users' expectations.
2. It is d foundation of d whole software product; all work products are indirect products of this document.
3. All work products, including testware must trace back 2 specific requirements.
4. The majority of software defects originate with errors in this document.
• d re are several ways 2 verify a requirements specification:
1. Conduct peer reviews or walk-throughs.
2. Review d document using a requirements checklist.
3. Compare it 2 d concept document or a specification 4 a competitive product.
4. Issue it 2 people N 2 ask d m 2 describe d system.
5. Develop simple use cases N see if it addresses all of d issues raised.
The following are ideas 4 creating a verification checklist 4 a functional design. Omissions
1. Is every requirement represented in d design? Are requirements referenced?
2. Are all d screens, reports, commands, inputs, N responses included?
3. Are d re enough examples N diagrams?
4. Where necessary, are d reasons 4 design choices explained?
Errors
1. Are d re mistakes in d translation of d user requirements?
2. Are d re mistakes in definitions presented?
3. Are d re errors made in calculations?
4. Are d re any features that are NOT included in d requirements specification?
Ambiguity
1. Can general statements be interpreted in multiple ways?
2. Are d verbs used d best ones 2 explain d intended behavior?
3. Are pronouns used properly, or can d ir subject be misunderstood?
4. Is it always clear which is acting, d program or d user?
Verifying d Functional Design
• Software design translates product requirements into specifications of:
1. How d system will be built - its internal design.
2. How d system will function - its functional or external design.
• d functional design describes d product's interface N behavior 4m d perspective of d USER.
• When testers speak of verifying d software design, d y are almost always referring 2 verifying d functional design.
• When verifying d design, we look 4 :
1. omissions
2. errors
3. ambiguity.
• d functional design should be presented concisely, using language N diagrams that can be readily understood by both users N developers. Even though technical reviews are usually carried out by developers, testers can learn a lot in d se sessions. We might also pick up useful information by reading d internal design documents. In d se we should see things like product limits, possible failure conditions, boundary conditions, N other white box testing considerations.
Note: all d se terms are discussed in d next few chapters. A code checklist is 2 o long 2 present here. Most checklists cover d various kinds of common programming errors including mistakes in:
i. data referencing
ii. logic
iii. computations
iv. function interfaces
v. external functions
vi. standards 4 naming, comments, etc.
Verifying d Internal Design N d Code
• Other software products that are usually verified include d internal design N d program code.
• d se products require technical verification, so d se tests are usually carried out by developers.
• Components of d internal design are: data structures, data flows, program structure N program logic.
1. When verifying an internal design, we look primarily 4 omissions N errors.
2. IEEE Recommended Practice 4 Software Design
• d code is d application itself; it is often verified in desk checks, walk-throughs, N inspections.
• Code inspections rely on checklists developed using standards documents N common errors.
• Code walk-throughs simulate d application running simple scenarios that get participants thinking N questioning program assumptions N implementation.
Verifying Testware
• Testware, like software, should be verified as it is built.
1. For testware, d 'requirements specification' is d test plan.
2. Test plans N tests should be verified before d y are used.
• Test plans should be checked 4 d following:
1. A clear N feasible testing strategy
2. A functional description of what is 2 be tested N 2 what degree
3. Resource requirements N schedule
4. Testing dependencies
5. Descriptions of tests or test suites
6. Realistic completion criteria.
• Tests should be checked 4 d following:
1. Author, objectives, test subject, N trace information
2. Configuration, resource, N setup requirements
3. Sequenced test steps
4. Expected results that correspond with source documents
5. Evaluation N disposition criteria.
Verifying User Documentation
• User documentation, when well written, improves user satisfaction N lowers customer support costs.
• We verify user documentation looking 4 problems of:
1. Omission, such as missing features, or incomplete explanations.
2. Accuracy, ranging 4m typos 2 incorrect commands, diagrams, or references.
3. Clarity, arising 4m confusing or ambiguous discussion or examples.
4. Organization that make d document less usable.
• Use requirements N functional specifications (and any other information you have) 2 verify d document(s).
• Check every explicit N implicit fact presented.
• Enter every keystroke in every example N try every suggestion provided.
• Check every screen diagram against d working program.
The Code Review Log is used when reviewing project code. It can be employed regardless of d verification technique selected (Formal Inspection, Walk-Through, Peer Review or Desk Check). It provides a record of defects found during d Code Review.
At d 2 p of d Code Review Log enter d following:
• Project name
• Release number
• Date of review
• Component being reviewed
• Module being reviewed
• Module version number
• d names of all review participants next 2 d ir role
In d table, record each defect found during d review. Space is provided 2 enter d
following information 4 each defect:
• Page #
• Line #
• Description of defect
• Category
• Type of defect
• Severity level

Sample Categories follow:
• Extra
• Incorrect
• Missing
• Suggestion/Enhancement
Sample Types follow:
• Data
• Documentation
• Functionality
• Interface
• Logic
• Performance
• Standard
• Other
Notes
The Code Review Summary Report should be used in conjunction with d Code Review Log.
The Code Review Log lists d defects found during d review N d Code Review
Summary Report summarizes d types of defects found by category N severity. It also
documents d outcome of d review (pass or fail) N captures metrics such as time spent on d review. d information at d 2 p of d Code Review Summary Report is d same as d Code Review Log with d addition of d column, “Prep Time”. In d “Prep Time” column enter d number of hours each participate spent preparing 4 d review. In d “Defect types by category N severity” table, tally up d number of defect types per category N severity level. In d “Inspection Summary” table, enter d information requested in d right column. At d bottom of d 4 m check whether d module passed d review or if it failed. If d module failed enter:
• d estimated number of hours 2 fix d defects
• d date d fixes should be completed
• d date of d next review
The Review Tracking Sheet is used when reviewing project documents. It can be employed regardless of d verification technique selected (Formal Inspection, Walk-Through, Peer Review or Desk Check). It provides a record of defects found during d document review. Enter d following Document Information:
• Project name
• Release number
• Title of d document being reviewed
• Document Number
• Document Version number
• Document Date
• Date d document will be distributed 4 review
• Date when d document must be reviewed OR
• Meeting review date
Enter d following Author Information:
• Name(s)
• Group (e.g., Development, Test, QA, Project Management, etc.)
• Location (e.g., Address, Building #, Floor #, Room #, Cube/Office #)
• Phone #
Enter d following Participant Information:
• Name of participant next 2 corresponding role
• Group (e.g., Development, Test, QA, Project Management, etc.)
• Prep Time - Amount of time spent preparing 4 d review
• Rating (use d following scale)
1. Approved
2. Approved with optional comments
3. Approved after required comments are incorporated
4. Not Approved. Another review is required
Review Tracking Sheet
Document Information
Author Information
Participant Information
(-continued-)
Project: Document Distribution Date:
Release: Must Be Reviewed by Date:
Document Title: Meeting Review Date (If applicable)
Document
Document Version:
Document Date:
Name Group Location Phone
Name Role Group Prep
Time Rating Initial & Date
Facilitator
Reader
Recorder
Reviewer
Notes
Enter d following Document Comments:
• A comment about d document under review
• d name of d person who submitted d comment
• Note whether d comment is optional or required
• d Status column is 4 use after d review. d author can use this column 2 :
Specify whether d comment has been incorporated into d document or not.
Note any Defect numbers opened as a result of d comment.
Enter d following Action Item information:
• Description of d action item
• Name of person responsible 4 resolving d action item
• d date d action item is required 2 be resolved
• d status of d action item (e.g., open, closed, etc.)

QTP Interview questions (faqs) set 9

1.Tell me about yourself.
2.Do you know any testing tools
3.How many projects you have executed using WinRunner
4.Which version of WinRunner you have used
5.You know Test director
6.What is your role as a Senior Test Engineer
7.Tell me the contents of Test Plan
8.How do u do effort estimation
9.You know anything about trade finance.
10.What is LC
11.What is revolving LC and non-revolving LC.
12.You know anything about Core Banking
13.What is NOSTRO and VOSTRO account
14.What is payment gate way
15.You know anything about SWIFT messages.
16.Tell me any one MT, which is using frequently in payment system
17.What is third party transfer
18.What is difference between QA and QC
19.You are QA tester or QC tester
20.What is white box testing
21.What is block box testing
22.What is gray box testing
23.What is full and plain Regression testing
24.Tell me defect life cycle
25.How will you assign severity, for identified bugs
26.What is defect dimension
27.Have you written test Cases for any project
28.How many projects you have executed and tell me the project names
29. Have you done UAT for any project
30. Have you done performance testing using Load runner
31. Are you willing to work in UK hours and week ends
32. What is boundary value analysis

QTP Interview questions (faqs) set 8

1)What is the difference between the black box testing and the white box testing?
2)What is test strategy document and test approach document?
3)What is adhoc testing?
4)Tell me about two critical bugs you found in your last project?
5)What are testing technics?
6)What is boundary value analysis and equalence value partioning?
7)Do you go out of your module to find bugs?
8)Tell me about ur self?
9)Can you brief about your previous project?
10)Do you have an experience in banking domain?
11)Do you have any knowledge in Brokerage?
12)What is sanity testing?
13)Did you invlove in prepartioin of test strategy and test doucument?
14)What you feel are the qualities of test lead?
15)What is NASTRO account and VOSTRO account?
16)What is current account and saving account?
17)What is regression testing?

QTP Interview questions (faqs) set 7

a) How you masure the 100% bug free through black box testing
b) How far you are comfortable with TSL(WinRunner)
c) Whats is your current responsibility
d) What is ad-hock testing ? why people do the adhock testing?
e) SQL
1.Tell me about yourself.
2.What is difference between QA and QC
3.Which version of WinRunner you have used
4.You know Test director
5.What is your role as a Test Engineer
6.Tell me the contents of Test Plan
7.Currently which project you are handling.
8.Is it Retail Banking or Corporate banking?
9.You know anything about Core Banking
10.What is NOSTRO and VOSTRO account
11.What is white box testing
12.What is block box testing
13.What is glass box testing
14.What is Regression testing
15. Tell me defect life cycle
16.Have you written test Cases for any project
17.How many projects you have executed and tell me the project names
18.What is exhaustive testing?
19.Without FS how would be your testing approach.
20.Do you know Silk Test?
21.Which version silk you used in your project
22.Do you know silk performer?
23.What is the difference between Silk and Winrunner?
24.Are you willing to work in UK hours and week ends
25.What are the techniques used in testing?
26.What is BVA and equivalence partition?

QTP Interview questions (faqs) set 6

1) Explain Different type of defect category with example
2) Difference between black box and white box testing
3) Explain project with workflow (Current and Previous Project)
4) How you are assured 100% tested in Ur module using black box testing
5) Explain Defect tracking
6) Explain Test Condition, Test Script
7) Role and Responsibility of Current Project and previous project
8) How you assure the 100% testing completed in black box testing

QTP Interview questions (faqs) set 5

1) Difference between black box and white box testing
2) Difference between Integration and Systems testing
3) Recording Mode in Win runner
4) Regular Expression in Win runner
5) Difference between retesting and regression testing
6) Explain Different type of defect category
7) Are u prepared any test plan and explain.
8) What are deliverable document in your previous project

QTP Interview questions (faqs) set 4

1. What is the difference between SDLC and SLC and either or same
or different..
2. What is Testing Life Cycle?
3. What are the phases of testing?
4. Difference between severity and priority.
5. What is test strategy?
6. How to document the test conditions.
7. What is mortgage loan.
8. What is the procedure to approach if file specification is not
Available.
9. What is vostro and nastro.
10. What is pre-payment penalty.

QTP Interview questions (faqs) set 3

1. What is Testing Life Cycle.
2. What are the phases of testing.
3. What is test strategy.
4. Difference between severity and priority.
5. Example for High/Medium/Low Severity and Priority
6. What are the contents of test strategy
7. Define regression testing (do not explain).
8. What is Defect Management / How will you escalate and close defects
9. Difference between Integration testing and System testing
10.Difference between System testing and UAT
11.Where are defining severity and prority (classification)
12.Content of Defect Report
13. What model are you using for Testing and Explanation of V model?
14. What is Grey box testing?

QTP Interview questions (faqs) set 2

1. What is defect Density?
2. What is Test Log?
3. What is test effectiveness & Efficiency?
4. How do you test the Date & Time through win runner compare to system?
5. Give me traceability matrix Format
6. Give me negative Test cases for uninstall the software
7. Give me negative Test cases for Excel sheet
8. How do test load test manually?
9. Example for the low priority high Severity
10. Example for the high priority low Severity
11. What are entry criteria? Contents
12. What are Exit criteria?
13. What is accepting criteria?
14. What is suspense criteria?
15. What are the disadvantages for bitmap check points?
16. What is configuration management? Tools used?
17. .what is Decision making table, where this will be used.
18. .How will you estimate the time to write the test cases? on what basis will you write the test cases,
19. .How will you calculate the time to execute the test cases?
20. .I have client server applications where the client request to server is taking 3 mins how will you test?
21. How will you check the performance at this stage?

QTP Interview questions (faqs) set 1

1. Explain Bug Life Cycle and explain briefly the 'Status' also.
Ex: If the Bug is resolved or the Bug is rejected or Bug is re-opened then at that duration the Bug will be called as which Status?
2. What is Traceability Matrix
3. . If U had 10 days to deliver the product but the CEO of ur organization tells to deliver it in 5 days, then How and what Testing Techniques or Strategy you will follow in order to deliver it in short time (5days)
4. What Testing process are U using in ur organization
5. During the Requirement phase (Initial), do U do any testing?
6. When to Stop Testing
7. What are the Test Case Guidelines
8. U have a Scenario and there is box to enter values from 0 to 1000
9. Now what is the Test data u will test
10. What are the positive and negative test cases
11. How will U use Equivalence Partition
12. . If U have Test Cases already prepared and u have to just excute those test cases in a very short time then how will U decide which test cases has to be excuted first. Is there any technique?
14. During Execution time how the testers will calculate the number of Test Cases to be runned? Any Specific way to calculate
15. If U are executing and test cases and u find some extra bugs in the application and u have not written such Scenarios in the Test Cases then what will u do?
16. If Ur project consists of multiple bugs then how will U deliver it in a very short span of time to the Client?
17. During Regression Testing how will the testers judge or calculate that the changed module (Done by developers) will affect the rest of the modules or not.
18.Since the testers are just doing black box testing , so how will the testers know that the code changed will affect the rest of the modules or not?
19. If the Developers are unable to understand the bug send by the testers, then how will the Testers convince or explain the developer.

What are different Testing methodologies ?

There are few different testing methodologies.
Test plan Driven Methodology.
Functional decomposition methodology
Combined methodology

Functional decomposition and Data-driven testing methodologies are plat form and testing tool independent.
That mean both these above methods can be used with any testing tool that generates script.
By using Data-driven testing methodology allows the user to create a script with out even knowledge of scripting language.

What is the difference between interface testing and integration testing?

Basically there is not much difference between these two terms. Integration testing mean, testing a complete project/product after integrating the individual components(of that project) into a single component(application).

Interface testing means, interfaces are normally acts as a liaison between two different components or architecture. Interface transfers data between these two components. So in order to complete a project sometimes we need to take the help of interface to connect the 2 different components. Testing of all these together when combined is called interface testing.

What is the difference between a Project & a Product? (or) a Project testing & a Product testing?

A project is normally a client specific. i.e we develop a project depending upon the requirements of the client, when we completely meet the client requirements, then the project is said to be completed. So testing of such thing is called a project testing.

Where as a product means company specific, which later can be modified every time when a new client buys the product. The product is modified every time when a new client comes and says his requirements. The very common things like managing payroll systems, e-commerce , buying/selling etc will be managed in a product. Testing of such a product is called product testing.

Difference between web application testing & Client-server testing ?

First plz note the major difference between client server & web based applications is the architecture difference between client server & web based applications. Client server is a two-tier architecture and web based applications are normally 3-tier architecture.

Client server applications are straight forward and they are predictable and the transactions are limited in number. Where as web based applications are un predictable and more number of transactions than client server.

In client server applications the main categories that come into picture are Software, hardware, LAN, etc..
In web based applications, Software, hardware, Routers, Firewalls etc..

Is it possible to send First action’s output as the input for the second action?

Yes it is possible to send Action1’s output as Action2’s input. First save the action1’s result(output) into a variable v1.
Then while executing Action2, pass V1 as a parameter to the action2.

Explain ‘Option explicit’ in QTP? What is the benefit of Option explicit in qtp?

Option explicit is used to declare the variables in QTP script. Normally we use DIM to declare variables in QTP script. For this to declare we need to mention option explicit on the top of the script. If we declare option explicit and not declared any variables, then it shows an error.

Does QTP support Multimedia?

Present version of QTP doesn’t support multimedia. Earlier versions used to support multimedia.
That’s the reason present version of QTP doesn’t support to test Game software that are made using multimedia.

Define the different types of objects that are used in QTP (quick test pro)?

There are several object types that are very commonly used in QTP:

Web objects:
Standard Windows objects:
Visual basic objects:
Utility objects:
ActiveX objects:
Supplemental Objects:

All these objects methods and properties are used to test the respective object model.
For example, visual basic objects methods and properties are used to test visual basic objects.

Can you explain what is QTP?

Quick test pro (QTP) is a graphical user interface tool which is used to record and playback various applications in different domains like web applications, windows applications, ERP applications like sap & people soft, cam also record and play back active X components etc…

What do you know about Test fusion report in QTP?

Once after running the test, The test fusion report displays the Results report, and a collapsible & expandable tree view of all the executed steps(run time) along with the screen shots of each and every step and the test data that has been used while running the test. It also enables us to know where exactly if any errors occurred during the run. By seeing the screen shot of the error step we can edit / modify the script and re run the script. Normally by combining the test fusion reports with QTP you can share all the documents / reports among the Quality and development teams.

List the important features and uses of QTP (quick test pro)?

QTP operates as a stand alone application and also it can integrate efficiently into mercury’s Test director, Quality center. It introduced new feature called keyword driven testing apart from data driven testing methods in QTP. Enabling check points efficiently to benefit in finding even the smallest changes in the existing build (application). Also introduced smart identification functionality to dig the objects and its properties which is very much useful to find out unidentified objects in recording/ run mode. It enables a powerful feature of auto documentation functionality.

What are the different versions of QTP? List difference between them.

QTP 9.0
QTP 8.2
Some other old versions….

The major difference between qtp 8.2 & qtp 9 are:
Qtp 9 supports replay feature in Mozilla firefox 1.5
In qtp 9.2 we can use the user interface to change the name properties of the check points. But in qtp 8.2 it is not possible.

What kind of applications (software technologies) we can test efficiently using mercury QTP (quick test professional) ?

QTP stands for quick test professional which is a mercury’s product for automation testing (functional & regression testing) of below technologies.

Windows applications,
People soft
Java
SAP
ERP
Oracle
Siebel
VB
Dot net
ASP
Java script
And some Others…

Note: you need add-ins for using QTP on different technologies.
For example to work on ERP(SAP, people soft etc..) applications you need SAP add-ins, people soft add-ins etc…

What is the difference between Image check point and Bitmap check point?

By using image check point we can check the properties of an image whether they are matching with the recorded properties or not.
These properties includes image file path, href links, owner of the image tec.. if these properties are not same as the original recorded version, then the script fails.
By inserting a standard check point we can insert this image check point on any image in the application. Image check points are normally supported by web based applications.

On other hand, Bitmap check points consider a specific selected area as a bitmap image after capturing that area as a bitmap image. This is normally used for a variable webpage. i.e for a webpage with a tendency of varying its page contents in terms of its displayed objects in terms of length , X Y coordinates etc. For example in a webpage the welcome note is 4 lines initially when you first recorded the webpage. But after few days while running the same script it will fail because the welcome note has been changed to 8 lines instead of 4 lines initially. By using bitmap check points we can capture this issues.

Explain the keyword view and expert views in QTP?

QTP (Quick test pro) is a keyword driven process. QTP provides an integrated environment from scripts to objects and its properties via many interfaces that included keyword and expert view also. Keyword view contains the steps in a graphical representation and screen shots of the navigation run.

Where as a expert view represents the script in code mode for experts who can understand the code and modify or debug when needed.

Explain the process of handling run time data?

Runtime data can be handled in QTP by parameterization. There are data sheets that are available in QTP called local data sheets. They are like excel sheets in the qtp lower panel. By using this we can capture output data from the scripts and/or can pass the parameters from this sheet to the script while running the script.

Can you explain in detail the Testing process in QTP?

There are seven important phases in QTP testing process.
First creating a test plan:
Creating test plan is an important step before you do automation. Prepare a clear procedure of what you are planning to test and the detailed steps that involve testing activities, what type of data you are going to input to the test including test data if possible.

Record the Application under test:
Now record the application by navigating through the application. Before recording the script, it is important to familiarize the application, navigation procedures etc.. When you navigate through the application while recording, QTP records each step that you navigate. QTP captures each event ex: click on a link, mouse over, click a button etc..

Script Enhancing:
Once after recording the script, now you have to enhance the script by editing the generated script. You can insert a piece of code in the script according to your need.

Also can insert existing functions from QTP functions list or can write a custom function to achieve the goal.

Enhancing also includes inserting check points, break points, using parameters to replace the constants.

Debugging the script:
Debugging is required only when any changes are made to the script, and you need to check the functionality whether it meets the requirements.

Running the test:
Once after script generation is finished, then runt he script and check if all the transactions are passed, and all the iterations are passed.

Analyze the results:

Clearly verify the results and find out if there are any defects or errors noticed.

Defect tracking (reporting):
If you find any defects then report the defects through a defect tracking system( test director etc..) and assign the defects to the developer who is responsible to this error. If the defects are network related, then assign to network personnel, if it is a database error then assign to database admin panel etc..

What are the advantages of using QTP as a functional testing tool?

- QTP is very easy to use and easy to learn even for beginners.
- The interface and the navigations are very simple, with little or no difficulty you can be an expert.
- QTP will represent the test cases as business workflows to the users. That is like eating banana in understanding it.
- Lot of features are getting added to its original version for the ease of users (testers).
- QTP uses a easy scripting language that is micro soft’s VB scripting. It includes many extra features of what Microsoft provides to VB.
- QTP is very easy to use and to create test cases for a normal user with little or no experience when compared to win runner.
- QTP provides data table integration in a flexible form to play with data as variables (parameters).
- QTP provides an excellent feature of parameter with more flexible options and easy to use which solves almost all industry critical situations.
- QTP provides the active screens, so once recording the script, you can enhance the script in what ever way you want.
- Objects and object properties can be identified in an advanced method in QTP.
- There are so many functions available in QTP that are available in library and can be used in the script directly by calling them. These functions are from QTP and vb script aswell.
- QTP supports XML and .net framework.

Can you tell me in detail about .qfl & .vbs extensions that are used for QTP files ?

In QTP normally we use three different types of extensions.
.QFL is local to the QTP and will be called and also used by only QTP.
Where as .VBS & .TXT files can be used by QTP and as well as other application as well.

And one more difference is in QFL you can put a break point, where as in .VBS you can not put a break point.
In general all of these three extension files can be used to define a function and then use this file(function) in QTP.

And the last difference is .QFL files you need to associate with test to call it. But .VBS functions you need not associate them to the test you are calling from. You can simply use executeFile statement to call vbs file.

Can you explain the difference between Object repository and object spy in QTP?

Object repository contains the recorded object and its information. It’s a container of objects that can be changed as required by the script.
Object spy is the one that can be use to check the objects and object properties in the application. A head with a hat symbol indicates the object spy in QTP. When some objects are not generated / recognized in the script while recording. In this case we normally go for object spy option in QTP.

Tell me the difference between Call to existing action & Call to copy action in QTP?

In call to existing object, only the reference of the original object will be copied into the called action. And that too it will not be editable. When we need to use an existing objects with out modifying them, we can use call to existing action.

Where as call to copy action means calling the original action by itself. That means not an instance but the original object itself copied into the calling action. And of course it is editable. You can edit and change the action as desired.

How can we change a custom defined object into standard object?

From tools Option in the QTP tool we can do this by mapping the custom class to standard object class from object identification dialog box. .Alternatively you need to define a custom object as a virtual object and then by mapping that virtual object to a standard object class by using a virtual object manager you can achieve this task.

How to access values from an excel sheet cell ?

To access value from Local Action Sheet of Run Time Data Table,

use the following.Datatable.GetSheet("Sheet Name").SetCurrentRow("Mention Row Number from where you want to access the value")Cell_Value = Datatable.GetSheet("Sheet Name").GetParameter("Mentioned Column Name from where you want to access the Value").ValueMsgbox Cell_Value

To access value from Global Data Sheet of Run Time Data Table, use the following.Datatable.GlobalSheet.SetCurrentRow("Mention Row Number from where you want to access the value")Cell_Value = Datatable.GlobalSheet.GetParameter("Mentioned Column Name from where you want to access the Value").ValueMsgbox Cell_Value

QTP vs Winrunner differences comparision





















How to connect to a database from QTP?

Use the below code for connecting a database from QTP.Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID=;PWD="
objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic
ObjRecordset.Source="select field1,field2 from testTable"
ObjRecordset.ActiveConnection=ObjConnection
ObjRecordset.Open 'This will execute your Query
If ObjRecordset.recordcount>0 then
Field1 = ObjRecordset("Field1").Value
Field2 = ObjRecordset("Field2").Value
End if

What is the difference between Check points and Output values ?

Check points are normally used to check the screen values, screen object properties to find out if there are any changes from the recorded version.

Where as output values are used to check the properties of the objects and these properties will be written to the data table columns in the sctipt.

Use the below code to validate if the checkpoint is passed or failed:
chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))if chk_PassFail then MsgBox "Check Point passed"else MsgBox "Check Point failed"end if

Use the below code to stop any exceptions that will raise due to check point failure.Reporter.Filter = rfDisableAll 'Disables all the reporting stuff
chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))
Reporter.Filter = rfEnableAll 'Enable all the reporting stuff
if chk_PassFail then
MsgBox "Check Point passed"
else
MsgBox "Check Point failed"
end if

What is the use of Actions and Functions in QTP? What do you know about Actions, functions in QTP?

Actions are specific to QTP. Normally a single or combination of multiple actions make a QTP script. Actions can associate with OR (object repository).

Functions are a piece of VB script code that has a variables and after execution will produce a return value that will be passed to the script back for further usage. Functionas can not associate with OR.

When we need to add some functionality to qtp script then we go for functions and call them in scripts.

What do know by ADD-ins in QTP? Properties of Test object? Runtime object?

Test objects are the one that will be recognized by QTP, where as Runtime objects are the actual objects that the test objects will be linked to.

SetTOProperty() function is used to change the properties of a test object.
Similarly GetROProperty(outer text) is used to get the outer text of object. Or you can use,
Webelement().object.outerText = “asasasasssa”.

How do you deal with Library files (VB script files)? How do you add library files in a test ?

How do you deal with Library files (VB script files)? How do you add library files in a test ?

Library functions are nothing but common vb script coding snippets . This group of small piece of codes are made as functions , procedures, classes, methods etc.. and they are stored in libraries with a meaning full name.

In Script-Testing, we can associate a library function to a test even at run time.

When we associate a library file in a test, then all the related functions with in the library are available to all the actions of the script. Where as if you use an executable function to call the library, then only that particular action from where we are calling the executable function will have permission to use the library functions.

Keywords:
QTP, library functions, library files, vbscript functions, vbsctipt codes, executable files, vb script code, QTP, mercury QTP, Functional testing, testing tools

What do you know about Recovery scenario? What are the components of Recovery scenario? How do you use recovery scenario? When and where to use Recove

What do you know about Recovery scenario? What are the components of Recovery scenario? How do you use recovery scenario? When and where to use Recovery scenario?

As its name indicates, Recovery scenario gives us an option to recover from unexpected errors in QTP. It will recover from any type of errors whether it is a fatal error like object not found, path not found, system error etc… or a small error like pop up error, out of paper from printer etc…

The main components or steps that exist in a recovery scenario are:
Trigger:
A trigger is an even that initiates the recovery scenario to start working. These events can be fired by any action like ‘A sudden pop up’, ‘application error’, or change in the property of any object etc…

Action:
Action is a single or series of steps to be followed after the recovery scenario is triggered by an event. What to be done after recovery scenario is triggered? Any key board event, mouse event, calling any function to execute etc…

After these actions are executed, we can also set what to be done after this? Got o next executable step and go ahead from there? Etc…

In normal cases, recovery scenario is used when you are not able to find out the root of the error or place of the error. Because some errors may raise outside the QTP like ‘out of paper’ etc..
But if you know the line exactly where an error may raise in QTP, then you can use ‘Error resume next’ function instead of recovery scenario.

What is Smart Identification? What is its use in QTP?

Smart identification is normally used when a particular object in the script is not found or, if the the object properties have been changed over a period of time and QTP not able to recognize the object.

Smart Identification is a internal algorithm used by QTP. Smart identification feature is being enabled when an object is not recognized by QTP.

Smart identification should not be enabled during recording the script. You have to disable this feature. Once after the script is generated, then you can enable the smart identification feature.

The secret behind the smart identification is: Even though the object properties have been changed during a period of time, there will be some common points that still exist in both the versions of the object. Smart Identification catches that common property and recognizes the object. Smart identification is an important feature in QTP.

Did you write any custom function in QTP?

Yes, I have written a custom function in QTP for editing the Data table row colors.
Below is the code for this using Excel COM api’s.
Set xlApp=Createobject("Excel.Application")
set xlWorkBook=xlApp.workbooks.add
set xlWorkSheet=xlWorkbook.worksheet.add
xlWorkSheet.Range("A1:B10").interior.colorindex = 34 'Change the color of the cells
xlWorkSheet.Range("A1:A10").value="text" 'Will set values of all 10 rows to "text"
xlWorkSheet.Cells(1,1).value="Text" 'Will set the value of first row and first col
rowsCount=xlWorkSheet.Evaluate("COUNTA(A:A)") 'Will count the # of rows which have non blank value in the column A
colsCount=xlWorkSheet.Evaluate("COUNTA(1:1)") 'Will count the # of non blank columns in 1st row
xlWorkbook.SaveAs "C:\Test.xls"
xlWorkBook.Close
Set xlWorkSheet=Nothing
Set xlWorkBook=Nothing
set xlApp=Nothing

How can I find if a parameter is there in a global sheet?

Val = DataTable(“parameter name”, dtGlobalSheet)
If err.number <> 0 then
Print ‘parameter not exist’
Else
Print ‘parameter exists’
Endif.

DataTable() function returns a value in integer into err.number.

Descriptive Programming in QTP

Introduction:
This document demonstrates the usage of Descriptive programming in QTP 8.20. It also discusses situations where Descriptive programming can be used. Using Descriptive Programming automation scripts can be created even if the application has not been developed.
Descriptive Programming:
Whenever QTP records any action on any object of an application, it adds some description on how to recognize that object to a repository of objects called object repository. QTP cannot take action on an object until unless its object description is in the Object Repository. But descriptive programming provides a way to perform action on objects which are not in Object repository

Object Identification:

To identify an object during the play back of the scripts QTP stores some properties which helps QTP to uniquely identify the object on a page. Below screen shots shows an example Object repository:


Now to recognize a radio button on a page QTP had added 2 properties the name of the radio button and the html tag for it. The name the left tree view is the logical name given by QTP for the object. This can be changed as per the convenience of the person writing the test case. QTP only allows UNIQUE logical name under same level of hierarchy. As we see in the snapshot the two objects in Browser->Page node are “WebTable” and “testPath”, they cannot have the same logical name. But an object under some other node can have the same name. Now with the current repository that we have, we can only write operation on objects which are in the repository. Some of the example operations are given below

Browser("Browser").Page("Page").WebRadioGroup ("testPath").Select "2"

cellData = Browser("Browser").Page("Page").WebTable ("WebTable").GetCellData (1,1)

Browser("Example2").Page("Page").WebEdit("testPath").Set "Test text"

When and Why to use Descriptive programming?

Below are some of the situations when Descriptive Programming can be considered useful:
1. The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout <>”.
2. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object.
3. When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository

Scenario 1: Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing

Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page.

4. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well.
5. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach.

How to use Descriptive programming?

There are two ways in which descriptive programming can be used
1. By creating properties collection object for the description.
2. By giving the description in form of the string arguments.

1. By creating properties collection object for the description.

To use this method you need first to create an empty description

Dim obj_Desc ‘Not necessary to declare
Set obj_Desc = Description.Create

Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”, “Value” and “Regular Expression”.

obj_Desc(“html tag”).value= “INPUT”

When you use a property name for the first time the property is added to the collection and when you use it again the property is modified. By default each property that is defined is a regular expression. Suppose if we have the following description

obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”

This would mean an object with html tag as INPUT and name starting with txt. Now actually that “.*” was considered as regular expression. So, if you want the property “name” not to be recognized as a regular expression then you need to set the “regularexpression” property as FALSE

obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”
obj_Desc(“name”).regularexpression= “txt.*”

This is how of we create a description. Now below is the way we can use it

Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”

When we say .WebEdit(obj_Desc) we define one more property for our description that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web page).

If we know that we have more than 1 element with same description on the page then we must define “index” property for the that description

Consider the HTML code given below




Now the html code has two objects with same description. So distinguish between these 2 objects we will use the “index” property. Here is the description for both the object

For 1st textbox:
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
obj_Desc(“index”).value= “0”

For 2nd textbox:
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
obj_Desc(“index”).value= “1”

Consider the HTML Code given below:




We can use the same description for both the objects and still distinguish between both of them
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”

When I want to refer to the textbox then I will use the inside a WebEdit object and to refer to the radio button I will use the description object with the WebRadioGroup object.

Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘Refers to the text box
Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘Refers to the radio button

But if we use WebElement object for the description then we must define the “index” property because for a webelement the current description would return two objects.

Hierarchy of test description:

When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions
from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have
been described using programmatic descriptions, QuickTest cannot identify the object.

For example, you can use Browser(Desc1).Page(Desc1).Link(desc3), since it uses programmatic descriptions throughout the entire test object hierarchy.
You can also use Browser("Index").Page(Desc1).Link(desc3), since it uses programmatic descriptions from a certain point in the description (starting
from the Page object description).

However, you cannot use Browser(Desc1).Page(Desc1).Link("Example1"), since it uses programmatic descriptions for the Browser and Page objects but
then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot
locate it in the repository because the parent objects were specified using programmatic descriptions).

Getting Child Object:

We can use description object to get all the objects on the page that matches that specific description. Suppose we have to check all the checkboxes present on a web page. So we will first create an object description for a checkboxe and then get all the checkboxes from the page

Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create
obj_ChkDesc(“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”

Dim allCheckboxes, singleCheckBox

Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc)

For each singleCheckBox in allCheckboxes

singleCheckBox.Set “ON”

Next

The above code will check all the check boxes present on the page. To get all the child objects we need to specify an object description i.e. we can’t use the string arguments that will be discussed later in the 2nd way of using the programming description.

Possible Operation on Description Object

Consider the below code for all the solutions
Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create
obj_ChkDesc(“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”

Q: How to get the no. of description defined in a collection
A: obj_ChkDesc.Count ‘Will return 2 in our case

Q: How to remove a description from the collection
A: obj_ChkDesc.remove “html tag” ‘would delete the html tag property from the collection

Q: How do I check if property exists or not in the collection?
A: The answer is that it’s not possible. Because whenever we try to access a property which is not defined its automatically added to the collection. The only way to determine is to check its value that is use a if statement “if obj_ChkDesc(“html tag”).value = empty then”.

Q: How to browse through all the properties of a properties collection?
A: Two ways
1st:
For each desc in obj_ChkDesc
Name=desc.Name
Value=desc.Value
RE = desc.regularexpression
Next
2nd:
For i=0 to obj_ChkDesc.count - 1
Name= obj_ChkDesc(i).Name
Value= obj_ChkDesc(i).Value
RE = obj_ChkDesc(i).regularexpression
Next

2. By giving the description in form of the string arguments.

You can describe an object directly in a statement by specifying property:=value pairs describing the object instead of specifying an object’s
name. The general syntax is:

TestObject("PropertyName1:=PropertyValue1", "..." , "PropertyNameX:=PropertyValueX")

TestObject—the test object class could be WebEdit, WebRadioGroup etc….

PropertyName:=PropertyValue—the test object property and its value. Each property:=value pair should be separated by commas and quotation
marks. Note that you can enter a variable name as the property value if you want to find an object based on property values you retrieve during a run session.

Consider the HTML Code given below:




Now to refer to the textbox the statement would be as given below

Browser(“Browser”).Page(“Page”).WebEdit(“Name:=txt_Name”,”html tag:=INPUT”).set “Test”

And to refer to the radio button the statement would be as given below

Browser(“Browser”).Page(“Page”).WebRadioGroup(“Name:=txt_Name”,”html tag:=INPUT”).set “Test”

If we refer to them as a web element then we will have to distinguish between the 2 using the index property

Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html tag:=INPUT”,”Index:=0”).set “Test” ‘ Refers to the textbox
Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html tag:=INPUT”,”Index:=1”).set “Test” ‘ Refers to the radio button


Reference:
1. “Mercury QuickTest Professional, User’s Guide, Version 8.0.1”

Data Tables in QTP

How many types of Data Tables are there in qtp ?

There are two types of Data tables:

1) Global data sheet:

The data in the global data sheets are accesible to all the actions in the script.

2) Local data sheet.

The data in the global data sheets are accesible to only to those actions i the current script.

Data tables can be used by using the below code:
DataTable(“column name”, dtGlobalSheet)

DataTable(column Name”, dtLocalsheet).

Normally we can change the data table values even in the runtime. But those changes will reflect only during the runtime. They will only change the run time data table. And if you want, this run time data can be exported by using datatable.export or datatable.exportsheet functions.

Because you can not save the changes made in runtime to the actual data tables.