Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using only a Shared Repository
#1
Solved: 10 Years, 9 Months ago
Good day all,
I'm new to the forums and have a question I can't find the answer to. I hope someone can help. I've taken a couple of online classes, but other than that, I'm self taught in QTP.

Here is my issue.
Background info:
I'm using a terminal emulator for Extra.
The screen names and object names that QTP gets from the program when recording makes no sense and is almost alway TOO specific to actually be played back.
I have built a shared repository manually with screen names and object names with properties specific enough to be found every time but general enough that they can be found with any iteration.
I want to associate this shared repository with an action that I want to program. (I can do this part)
The action I'm going to program is very long and complicated so I REALLY want to record it once and just tweek it to use the DataTable where needed.
The Problem:
When I record the action, QTP creates a new local repository rather than using my manually created shared repository.
One solution:
I can edit the QTP script manually changing the screen and object names to look at my shared repository and it works. But that is a lot of work for this automation that is going to end up being tens of thousands of lines long.
My Question:
How do I FORCE QTP to look at and record from ONLY my shared repository?

Again, I'm mostly self taught, so if this is a rediculously easy solution, I appologize for my ignorance.

Brian
Reply
#2
Solved: 10 Years, 9 Months ago
I think you will have run your test using AUT
Open the test and load your required repository before running your scripts

Code:
Dim qtApp
Set qtApp = CreateObject("QuickTest.Application")
Dim qtRepositories
Set qtRepositories = qtApp.Test.Actions("Main").ObjectRepositories
qtRepositories.Add("C:VS.tsr")

Reply
#3
Solved: 10 Years, 9 Months ago
The issue isn't running the tests, it's recording them. Once the tests are recorded and the correct object repository is manually set by changing the screen and field names it runs fine. I do load the shared repository before I begin recording, but QTP still wants to create its own local repository rather than reading the object repository that I have specified.

Here is an excerpt from my shared and local repositories. In the image you can see my shared repository in the upper right and the inserted image of the local repository after I record. The screen also shows what QTP is recording.

I think that part of the problem is that QTP is looking somewhere other than where I tell it the screen label is at. I'm afraid I just don't know where QTP is getting that Screen40176 at, but it can capture 10 different numbers for one screen depending on what is displayed on the screen.

I'm open to any ideas at all.


Attached Files Image(s)
   
Reply
#4
Solved: 10 Years, 9 Months ago
If i understood it right, you want to record your test using a shared object repository. you want QTP to take the objects from your shared repository and not to create the new local repository.

Try associating the shared repository with your test. hope this will solve your issue.
Resources>Associate Repository

Reply
#5
Solved: 10 Years, 9 Months ago
Greetings!
I have a similar issue, where, after opening a script and associating my shared.tsr with the test (only one Action per test), after running the script, QTP throws runtime error The object "BrowserXXX" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object." (The object DOES exist in the AUT, and the object IS in the OR (both local and Shared.) Also, please note that another object on the same page and browser (whose names are static...do not change at all), IS found and recognized by QTP 9.2.
Thanks for any expertise provided.
Reply
#6
Solved: 10 Years, 9 Months ago
Hi Saket.
When I run your code with my QTP 9.2 script (using the path to my shared Repository, of course), I get a "General Run Error" on this line:
Code:
Set qtRepositories = qtApp.Test.Actions("Main").ObjectRepositories
Am I missing something here?
Thank you.
Reply
#7
Solved: 10 Years, 9 Months ago
I guess you have not replaced "Main" with your Action Name, right? if so try replacing the action name "Main" in the statement with your used action name. let me know if you still have any issue

Code:
Set qtRepositories = qtApp.Test.Actions("<<Action Name>>").ObjectRepositories
qtRepositories.Add("<<OR Path>>")

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating Shared repository vinod_3466 3 4,234 06-29-2016, 02:16 PM
Last Post: Ankesh
  QTP 11 - CreateFolder fails to create folder in shared network drive from Windows 7 Pallavi 3 3,393 02-25-2014, 02:04 PM
Last Post: guin.anirban
  Shared Object Repository issue ShekharUlli 2 3,280 09-20-2013, 02:56 PM
Last Post: ShekharUlli
  Copy file to network shared location sams001 0 2,962 04-03-2013, 02:10 AM
Last Post: sams001
  Can a make Shared OR be made a Local OR sams001 0 1,798 10-30-2012, 03:07 PM
Last Post: sams001

Forum Jump:


Users browsing this thread: 1 Guest(s)