qtp session day9

8
Confidential. Strictly for internal circulation only.

Upload: naresh-ramanadham

Post on 19-Jan-2016

11 views

Category:

Documents


0 download

DESCRIPTION

QTP Session Day9

TRANSCRIPT

Page 1: QTP Session Day9

Confidential. Strictly for internal circulation only.Confidential. Strictly for internal circulation only.

Page 2: QTP Session Day9

Day 9

2

Descriptive Programming

Page 3: QTP Session Day9

Descriptive Programming

3

Descriptive Programming is a method of performing operation on the object which is not there in Object Repository. In this process object properties will be used in script.

Page 4: QTP Session Day9

When to use Descriptive Programming

4

1. If the application is having Dynamic Objects

OR:- Difficult to handle Dynamic Objects using Object Repository

2. When we have more objects to perform operations

OR:- The performance will decrease if object repository is having huge number of objects.

3. If the application is having objects that are adding in the Run Time

OR:- We can’t add objects to Object Repository in run time.

4. If we need to start Automation before Build Release

OR:- There is no application to create Object Repository.

5. If Application is having similar type of objects or similar name objects

OR:- Object Repository will create multiple objects with same description unnecessarily.

6. Big Team Size

OR:- Shared Object Repository is not changeable by multiple persons at a time. Maintenance becomes harder if all the team members have created their own object repositories.

Page 5: QTP Session Day9

Advantages of Descriptive Programming

5

1. Version Free

DP:- Script can be executed in any version of QTP without any changes.

2. Code Portability

DP:- Just code is enough run script. We can copy and paste in other scripts for any other required requirement.

3. Reusing of Properties

DP:- We can assign properties to a global variable and reuse it for same type of objects.

4. Plug & Play

DP:- Any time scripts will be in ready to run state. No need to worry about any other settings or files.

5. Just Maintenance of variables

DP:- We can store the object properties in the form of variables in a txt / vbs file which will be placed in central location. In this case we just need to maintain that file.

Page 6: QTP Session Day9

Types in Descriptive Programming

6

• Static– You list the set of properties and values that describe the object directly in a VBScript

statement.Browser("micclass:=Browser").Page("micclass:=page").Link("name:=Login").Click

• Dynamic– You add a collection of properties and values to a Description object, and then enter

the Description object name in the statement.

Set oBrowser = Description.createoBrowser (“micclass”).value=”Browser”oBrowser (“name”).value= “Google”

Set oPage = Description.createoPage (“micclass”).value=”Page”oPage (“name”).value= “Google”Set oLink = Description.create

oLink (“name”).value= “Login”oLink (“index”).value= 1

Browser(oBrowser).Page(oPage).Link(oLink).click

Page 7: QTP Session Day9

7

Page 8: QTP Session Day9

8

SemanticSpace Technologies100 Pacifica Suite 270,

Irvine CA 92618,

Tel: (949) 789-7332

Fax: (949) 789-7334www.semanticspace.com

SemanticSpace Technologies100 Pacifica Suite 270,

Irvine CA 92618,

Tel: (949) 789-7332

Fax: (949) 789-7334www.semanticspace.com

Prolifics22 Cortlandt Street, 18th Floor,

New York, NY 10007

Tel: (212) 267-7722

Fax: (212) 608-6753

www.prolifics.com

Prolifics22 Cortlandt Street, 18th Floor,

New York, NY 10007

Tel: (212) 267-7722

Fax: (212) 608-6753

www.prolifics.com

Arsin Corporation

Suite 425, 4800 Great America Parkway, Santa Clara, CA 95054 -1228

Tel: (408) 653-2020

Fax: (408) 653-2030

www.arsin.com

Arsin Corporation

Suite 425, 4800 Great America Parkway, Santa Clara, CA 95054 -1228

Tel: (408) 653-2020

Fax: (408) 653-2030

www.arsin.com

Corporate HeadquartersCorporate Headquarters

European OfficesEuropean Offices

London, UKLondon, UK Hamburg, GermanyHamburg, Germany

Philadelphia, PAPhiladelphia, PA San Francisco, CA San Francisco, CA Irving, TX Irving, TX Atlanta, GAAtlanta, GA Orlando, FL Orlando, FL Cleveland, OH Cleveland, OH

US OfficesUS Offices

Boston, MA Boston, MA

India Office

Plot #226, Road #17

Jubilee Hills, Hyderabad-500033

Phone: +91 40 39991999

Fax: +91 40 23114651

India Office

Plot #226, Road #17

Jubilee Hills, Hyderabad-500033

Phone: +91 40 39991999

Fax: +91 40 23114651