Hi, In QTP is there a way to add objects to the Object Repository during runtime?

Showing Answers 1 - 4 of 4 Answers

Shankar

  • Apr 8th, 2006
 

Hi Padma.

Regarding u question i can give u this solution plz try once

In Scripting u have to write like:

Dim V1

Set v1= description.create()

v1("Propertyname").value=" " 'Wite a propertyname here like editbox

window("").object("Object Name"). Method(" Method Name like v1"). value

  Was this answer useful?  Yes

we can add object repository at runtime in 2 diff ways.



1. when u write below syntax in Action1

Syntax: RepositoriesCollection.Add(Path)
Ex: RepositoriesCollection.Add(E:ORObjRes.tsr)

if write in Action1 it will automatically add the Object
Respository to the Action1
(i.e Edit Menu-->Action-->Action Properties-->Associate
Repository tab) at runtime.

no need to add the object repository before running.


2. Add the object repository at runtime by using AOM
(Automated Object Model)

Ex:
Dim qtAppn
Dim qtObjRes

Set qtAppn = CreateObject("QuickTest.Application")
qtAppn.Launch
qtAppn.Visible = True

qtApp.Open "E:TestTest2", False, False
Set qtObjRes = qtApp.Test.Actions
("Login").ObjectRepositories

qtObjRes.Add "E:ORObjRes.tsr", 1

The above example Add the Object Repository(ObjRes.tsr) to
the "Login" action in Test2.

Here also no need to add the object repository in Test2.


CNU

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions