Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3 Actions vs 1 Shared Repository
#1
Solved: 10 Years, 9 Months ago
Hi folks,

i have written a test with 3 actions (1 login / 2 navigate / 3 test) in QTP 11 and i want to export the objects of all actions to a shared repository. Is that possible? Or do i have to build a repository for each action?
I want to reuse the objects and actions in my next tests. i have about 600 test cases.

Thanks in advance Rolleyes,
Regards
Stefan
Reply
#2
Solved: 10 Years, 9 Months ago
Hi Stefan,

Here you can take two approaches:

1. Build a Shared Repository in the beginning and Associate it with actions you want.

OR

2. Write/Record Code for all the actions first (Each action will have its local OR)and then Use Object Repository Manager>>Tools > "Update from Local Repository" Feature provided by QTP to merge your Local OR objects with a .TSR

I prefer the 1st approach.

Please let me know if you have any Queries.
Reply
#3
Solved: 10 Years, 9 Months ago
Hi Rajeshwar,

i have written a test with 3 actions in QTP 11, merged all objects to one repository (test.tsr) stored in ALM 11. I can see the 3 actions in my repository when i go in my test to Object repository > Associate Repositories > Associate Actions.

Now i want to reuse this action an another test with the same objects and the same script because "Login" is necessary for every test case. When i create another test an associate the shared repository, i can only find an "Action 1" in my fresh uploaded shared repository in ALM 11. I thought that i can now reuse the written action "Login" to my new created test. What i am doing wrong?

What i wanna do is modularize the tests in 3 pieces or actions: 1 is login, 2 is navigate and 3rd is the specific test case. So i want to write 1 and 2 only once. They will get Parameters from the Global Data Sheet. The 3rd is unique for all tests.

I thought that i can add action 1 and 2 to all my new tests and write only the 3rd part for every test case. I also thought that 1 shared repository can manage n actions. Am i right or not? i need an advice :/

Regards,
Stefan
Reply
#4
Solved: 10 Years, 9 Months ago
Hi Stefen,

You are right 1 shared repository can manage n actions.

1. Make Login and Navigate Actions Resuable.(Parametrize to take data from Global Data sheet as Its your requirement. I will prefer using Local Data Table)
2. Create a Shared OR for "Login","Navigate"
3. Save the Test.
4. Now Open a New Test.
5. You will have "Action 1" in your Test.
6. Insert Call to Login and Navigate Action(right click>> Actions>>Insert Call to an Existing Action)
7. Associate shared OR with "Action 1".
8. Continue Writing/Recording specific test case.

This is only one of the ways of acheiving Modulizaration.
Reply
#5
Solved: 10 Years, 9 Months ago
Hi Rajeshwar,

that works fine... thank you!! So i have to call an action out of an exisiting test... didn't know that. I thought that i can modularize my actions and save them as a modul in a (shared) repository and get them back.
So the best way would be to write a test "login" and another one "navigate" and get the reusable actions out of these tests in my next ones right? Smile Because ALL tests need to use "Login" all the time and in some cases "navigate" as well.

Next question: I create a new test, link my 2 actions and write my third like i described above. Now i want to save objects to my shared repository. Should i save the objects from my unique actions to my shared repository? I think not.. Login and Navigate saved in SOR and the specific action objects local?!

Why would you use a local data sheet instead of a global one? I thought about having one global sheet (= one Excel Sheet for Import) for every test with specific data in it e.g. with login for admin, for user.. with navigation to link1 and link2 and so on.. parametrized!

Thanks in advance Rajeshwar for your time and your answers... have a nice day..

Regards,
Stefan
Reply
#6
Solved: 10 Years, 9 Months ago
Hi Stefan,

By using Local Sheet we can achieve Modulirized Data. Imagine you have hundreds of Actions in you driver script and all are using a Data from Global Sheet Smile In this scenario its very difficult to tack the flow of the data.
In your case , Test has 3 actions, Login, Navigate and Some Application Specific Action say Add User action.You may want to create a test in which the Admin user logs onto the site once, Navigates to a Add User screen and Add 10 Users. The data about Users is relevant only to the Add user action, so it should be stored in the action tab corresponding to Add user action.

Global Data Sheet Usage:
1.When we want Data To be available to all the actions in our test
2.When we want our data to control Test iterations.

Local Data Sheet Usage:
1.When we want to use the data in Local Data Table for that action only.
2.When we want the data to control the number of action iterations.

Use Relative Paths while saving your reusable actions, it will make your life much easy.

Thanks,
Rajeshwar.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating Shared repository vinod_3466 3 4,241 06-29-2016, 02:16 PM
Last Post: Ankesh
  How to call Actions from other Actions Naresh 1 7,692 09-25-2014, 10:26 AM
Last Post: vinod123
  QTP 11 - CreateFolder fails to create folder in shared network drive from Windows 7 Pallavi 3 3,396 02-25-2014, 02:04 PM
Last Post: guin.anirban
  Shared Object Repository issue ShekharUlli 2 3,293 09-20-2013, 02:56 PM
Last Post: ShekharUlli
  Copy file to network shared location sams001 0 2,964 04-03-2013, 02:10 AM
Last Post: sams001

Forum Jump:


Users browsing this thread: 2 Guest(s)