Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add an object to repository through script
#1
Solved: 10 Years, 9 Months ago
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
Reply
#2
Solved: 10 Years, 9 Months ago
You can use Descriptive Programming.
Reply
#3
Solved: 10 Years, 9 Months ago
Can you please share with the sample code or function to use this option...

Thanks,
Reply
#4
Solved: 10 Years, 9 Months ago
(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
Reply
#5
Solved: 10 Years, 9 Months ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Do we need object repository?? subhashinid 0 1,854 07-06-2016, 10:07 AM
Last Post: subhashinid
  Object repository losing object properties ishan.mahajan@adp.com 2 3,435 08-20-2015, 11:33 PM
Last Post: ADITI1992
  login object not found in object repository Akram 2 2,967 06-01-2015, 07:47 PM
Last Post: babu123
  object was not found in the Object Repository reynard 0 6,628 03-17-2015, 10:54 PM
Last Post: reynard
  Change Object Repository File Path for ExternalActions MasterChief 1 4,424 11-13-2014, 06:05 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)