Object
Repository: It is a place where qtp stores the objects(Ex:buttons or Check
Boxes) information.
There
are two types of Object Repositories
i).Local Object Repository
By
default if we record any test,that goes to Local Object Repository.
We
can edit or delete object properties. Only that test can use that object
repository.
ii).Shared Object Repository
If
we create shared object repository,other tests can also
use
that shared object repository. We can’t edit object properties.
To
get more concepts on this.Go through below cases
1.How to create shared object
repository in qtp
Open
Blank Test
Goto Resources–Object Repository Manager
Object—Add
Objects
–>Open
ur application
and add objects of the application
save
it anywhere in ur
pc.
the
extension would be .tcr
Shared Object Repository Example :
Open
Blank Test
Goto
Resources–Object Repository Manager
–>open
ur Flight
Reservation Application
object–Add
objects
–>add
objects of ur
application
1.add
Agent Name edit box
2.add
Password edit box
3.add
ok button
File—Save
it
How to use shared object repository
in qtp
Goto Resources–Associate Repositories
One
Associate Repositories window appears
There
click on + symbol to browse the shared object repository
Goto
Available actions,bydefault Action1 would be present
click
on action1 and then click on > button
It
will add to Associated Actions
Click
ok.
Now
u can open local object repository and view the objetcs that
u
added through shared object repository.
We
can’t edit or delete those objects properties and values.
Now
u can write ur
testcase in expert view and execute
dialog(“Login”).WinEdit(“Agent
Name:”).Set “venkatesh”
dialog(“Login”).WinEdit(“Password:”).Set
“mercury”
dialog(“Login”).WinButton(“OK”).Click
How to export local object repository
into shared object repository in qtp
Open
Blank Test
Goto
Resources–>Object Repository
Open
ur Flight
Reservation Application
Goto
Object–Add objects to Local
Add
ur application
objects to ur
test
In
the same object repository window
Goto
File—Export Local Objects. It saves as .tsr file
So
that one any user use.
No comments:
Post a Comment