Page 1 of 1

Reusable recording

Posted: Mon Dec 09, 2019 1:42 pm
by prasoon.jmit
Hi,

I have one "Recording"that has "User Code". In "User Code" the method that is present that expect first argument as "Repository Item".
I want to use this "Recording" at multiple places and every time different "Repository Item" will be passed. Please help me how to achieve this.

Re: Reusable recording

Posted: Tue Dec 10, 2019 12:12 pm
by odklizec
Hi,

I'm afraid, there is currently no way to pass the repo element as variable. Therefore, the only thing you can do is to create multiple recording modules, where each module uses the same method (using user code collection) and then link different repo item in each recording module. So basically, each module will use the same method with different repo element.

Re: Reusable recording

Posted: Fri Dec 13, 2019 1:00 pm
by prasoon.jmit
Thanks for the reply.

Actually that will create duplicate sort of recordings and code maintainence will be difficult.

Suppose I have 2 nodes of tree in my wpf application. In one case click on node 1 is required while in other cases click on node 2 is required. Can't we achieve that using one recording only?

Re: Reusable recording

Posted: Fri Dec 13, 2019 1:08 pm
by odklizec
Hi,

I'm afraid, I don't know what kind of code sample you are looking for? For an example of method, with repo elements as parameters, check these posts:
https://www.ranorex.com/forum/empty-tex ... tml#p52915
https://www.ranorex.com/forum/change-se ... tml#p56855
https://www.ranorex.com/forum/using-ins ... tml#p56677

Re: Reusable recording

Posted: Mon Sep 21, 2020 3:00 pm
by raygoel
I also have this question. From the looks of it, Recording module appears to be a library of recordings that a user is building. I expected to be able to drag and drop these recordings from the module to my test cases.
Is there a way to achieve that? Or do I have to build user code modules to achieve this for my tests.

The scenario is that I have a few test cases (say T1, T2 and T3).
T 2 and T3 include the steps from T1 so I would want to use the recordings I made for T1 in T2 and T3.

Thanks in advance!
Ray

Re: Reusable recording

Posted: Thu Sep 24, 2020 7:27 am
by odklizec
Hi,

Of course, it's totally possible to use the same recording(s) in multiple test cases. Simply copy recording(s) in test suite view and paste it in any test case you want (at appropriate place). Eventually, you can drag them from module library or project view and drop them in test view. You just have to make sure that the recording(s) contains only the steps, which works with each TC where you want to use it.

Re: Reusable recording

Posted: Thu Sep 24, 2020 2:06 pm
by raygoel
Thanks odklizec!
That worked : )