Quality Testing

Quality is delighting customers

Can we add TWO object repository at run time in qtp?

Hi all,

 

Actually, Total 50 script in qtp, in my script two OR is already there , i don't no which OR is used which scripts. so i want to add two OR (shared) at run time. I am confused how to run this script.

i  used below code.

but we found error

 

Dim qtRepositories1 
   Set qtRepositories1 = qtApp.Test.Actions("Action1").ObjectRepositories

lngPosition = qtRepositories1.Find("OR PATH") ' Try finding the Debug.tsr object repository

 

If lngPosition <> -1 Then ' If the object repository was found in the collection

     qtRepositories.Remove lngPosition ' Remove it

   End If

 

Pls help me

 

 

Views: 118

Reply to This

Replies to This Discussion

we can add object repositories at run time directly.plz find the following script how to add repositories at runtime.

RepositoriesCollection.Add (plz specify path of the shared repository here)

and we can remove the shared repository at runtime also

RepositoriesCollection.Remove(path of the repository that we want to remove)

 

Yes, Kalyani  but i want to 2 OR Remove and 2 OR add  in run time. so first i want to remove OR and after ADD 2 OR.

Pls possible to any one give me code.

 

 

Ya Vimal.  What kalyani told is correct i think. We need some more clarity on your question. We can add 2 repositories and execute scripts. I am not clear on removing and adding repositoris again.?????

try this...

 

RepositoriesCollection.Add (plz specify path of the first repository here)

RepositoriesCollection.Add (plz specify path of the second repository here)

 

while running your code, iterate over each element in the repositories colelction

 

Hi Vimal,

According to ur question u just want to delete all the repositories that are present and u want to add two repositories at run time?

plz follow the following script then you can understand.

Example: I just want to take the Login application

dim path1,path2

RepositoriesCollection.RemoveAll

path1=plz specify the path of the first shared repository here.

path2=plz specify the path of the first shared repository here.

Repositoriescollection.Add(path1)

systemutil.run plz specify the path of the application that u want to open automatically.

---------

--------

------

---------

--------

repositoriescollection.add(path2)

------------

-------------

at last

repositoriescollection.remove(path1)

repositoriescollection.remove(path2)

 

 

or else wecan delete the two repositories at a time  by using the following statement.

repositoriescollection.removeall

 

I'l hope u understand the above concept that i wrote

 

still u have a doubt i'l send the example to u.

Thanks

 

Bye

bye

 

Hi manoj ,

I got solution for OR removing and adding through script,  Thanks all .

acctualy what happen , some Qa develop 50 scripts, and they can not add OR dynamically . so I want to Remove this OR dynamically with script and add OR.

and one More problem i have facing 

SCENARIO: when i run driver script , 5 script is working fine and six script half working fine but one function is not working through driver script. when i debug this script , function and all Lib function is working fine . even i run normal mode then getting error , Debug mode is working fine.

Pls tell me what is the problem in this script or lib files

what error u r geting????

RSS

TTWT Magazine

Webinar

You Can


Call for Articles

Advertisement

Videos

  • Add Videos
  • View All

Badge

Loading…

© 2012   Created by Quality Testing.

Badges  |  Report an Issue  |  Terms of Service