what are qtp actions

12
8/10/2019 What are QTP Actions http://slidepdf.com/reader/full/what-are-qtp-actions 1/12  Actions in QTP – The Basics

Upload: apextgi

Post on 02-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 1/12

 Actions in QTP – The Basics

Page 2: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 2/12

What you would read in this PPT:

What are QTP Actions.

What are the different types of QTP actions.

How actions access data from QTP data tables.

How to call actions in your QTP scripts.

Page 3: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 3/12

What is a QTP Action?

QTP Action is a placeholder or a component in which you can write your

scripts or code.

You can write your code in QTP actions in the same way you do in a

function library or scripted business component.

Just lie functions! actions also help to di"ide your test script into lo#ical

units or business flows.

$n fact! a QTP test script is itself a collection of one or more actions.

Whene"er you create a new test case! an action will also be created

automatically for that test case.

Page 4: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 4/12

What is a QTP Action % contd..

&ach test case in QTP consists of one or more actions and the flow of the

test case is determined by the order of action calls.

&'ample: (onsider a scenario where you

login to gmail >> send an email >> logout from gmail

This scenario can be scripted by addin# ) actions in a QTP test script as % 

Page 5: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 5/12

What is a QTP Action % contd..

*odulari+ation pro"ided by actions is similar to what is there with

functions. ,nly difference is the implementation.

.. is similar to ..

Page 6: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 6/12

-ifferent Types of QTP Actions

QTP actions can be classified into the followin# different types

Classification based upon reusability

Reusable Action

Non Reusable Action

Classification based upon where theactions are stored

External Action

Internal Action

Different Types of QTP Actions

NOTE: QTP documentation doesn’t specify an action type as ‘Internal’. We have just extended the ‘External

 Action’ type to come up ith ‘Internal Action’.

Page 7: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 7/12

-ifferent Types of QTP Actions % contd..

QTP actions can be classified into the followin# different types

-ifferent Types of  QTP Actions

/eusable Actions : These are the actions

that can be called multiple times by %

the same test in which it is stored! and

by other e'ternal tests also.

0on/eusable Actions : These are the

actions that can be called only once and

that too in the test where they are stored.

These can1t be called from e'ternal tests.

$nternal Actions : With reference to a

QTP test case! an internal action is one

that is stored within that test case.

This action can be reusable as well as

nonreusable.

&'ternal Actions : With reference to a

QTP test case! an e'ternal action is one

that is stored in some other test case.

&'ternal actions should be reusable

otherwise it can1t be used outside the

test case.

Page 8: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 8/12

QTP Actions and -ata 2heets

QTP pro"ides 3 types of inbuilt data sheets which can be used to store test

data.

QTP Actions can interact with these data sheets usin# inbuilt QTP

functions to

 read data from the data sheets! and to write data to the data sheets.

Types of QTP Data Sheets

Global Data Sheet Local Data Sheet

Page 9: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 9/12

QTP Actions and -ata 2heets % contd..

    G    l   o    b   a    l    D   a   t   a

    S    h   e

   e   t   s

l A 4lobal -ata sheet is onewhich can be accessed by allthe actions in the test case.

l &ach test case has only one4lobal 2heet.

l The name of the 4lobal -ata2heet is 54lobal1.

l This sheet can be used whenyou want to pass databetween multiple actions.

    L   o   c   a    l    D   a   t   a

    S    h   e

   e   t   s

l A local -ata 2heet is onewhich can be accessed byonly one action.

l The number of local sheets ise6ual to the number of

actions in the test case. 7&achaction will ha"e its own datasheet8

l The name of the local sheetis same as the name of itsassociated action.

l 9ocal data sheet can be usedto store data that would beused within that action only.

Page 10: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 10/12

(allin# Actions in your Test 2cripts

,nce you ha"e a set of actions internal or e'ternal; a"ailable with you!

you can call these actions in your test scripts.

The order in which you call your actions defines the flow of your test case.

&'ample: login to Gmail >> send an Email >> logout from Gmail

There are two ways in which you can call actions in a test script

2 ways to call actions in a test script

calling copy of an action calling an existing action

Page 11: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 11/12

(allin# Actions in your Test 2cripts % contd..

Call to Copy of an Action 

When you call the copy of an action intoa test case, the original action is copied

in its entirety.

If you mae any changes to the copiedaction, it will not affect the originalaction in any way.

!ou can call copies of actions when youwant to use the same action with somemodifications.

Call to Existing Action

When you call an existing action, theaction would be called as a read"only

action.

#he action can only be modified in thetest in which it is created. #his will affectall the tests where it is called.

!ou can call existing actions where youwant to reuse the same actions withoutany modifications.

Page 12: What are QTP Actions

8/10/2019 What are QTP Actions

http://slidepdf.com/reader/full/what-are-qtp-actions 12/12