Posts: 9
Threads: 6
Joined: Jun 2008
Reputation:
0
06-11-2008, 02:40 PM
Hi,
Is it possible to add an object to repository through script?
I have a requirement wherein, i need to add objects to repository dynamically .
Please help me in this regard.
Regards,
KP
Posts: 190
Threads: 2
Joined: Mar 2008
Reputation:
0
06-11-2008, 06:48 PM
You can use Descriptive Programming.
Posts: 4
Threads: 0
Joined: Jun 2008
Reputation:
0
06-11-2008, 09:10 PM
Can you please share with the sample code or function to use this option...
Thanks,
Posts: 190
Threads: 2
Joined: Mar 2008
Reputation:
0
06-11-2008, 10:01 PM
(This post was last modified: 06-11-2008, 10:04 PM by niranjan.)
(A)
Descriptive programming allows you to work with objects that are not stored in object
repository. two types of programmatic descriptions.
1) listing the set of properties and values that describe the object directly in a test
statement.
2) Add collection of properties and values to a Description object, and then enter the
Description object name in the statement.
In your case my suggestion was to use the second option. Yes, this does not add objects to OR but you can use the objects.
(B)
You can use SetTOProperty method of test object.
Object(description).SetTOProperty Property, Value
The values of test object properties are used to identify the objects. Sometimes the properties of
the object in the application change dynamically. For example text of a link in a webpage is the
username used to login to that page.
Text property is used by test object to identify the link. So in order to identify the actual object we
can manipulate the value of “text” property of link using SetTOProperty.
This can be used for existing Dynamic Objects in OR.
( c)
By Using Object Repository Automation Model.
You can use ObjectRepositoryUtil Object and apply Add Object Method.
For more info, please check QTP Help.
By using this: you can add objects to OR from your script
Posts: 9
Threads: 6
Joined: Jun 2008
Reputation:
0
06-12-2008, 08:53 AM
Hi Niranjan
Thanks for your help, i will go with last method i.e. using ObjectRepositoryUtil Object and apply Add Object Method.
Thanks for your help,
KP