Passing different values to recording module

Best practices, code snippets for common functionality, examples, and guidelines.
marlonc
Posts: 6
Joined: Mon Apr 03, 2017 12:29 am

Passing different values to recording module

Post by marlonc » Mon Apr 10, 2017 8:34 pm

Hi,

I have a recording module that accepts parameter. In one test case, I want the value to have A, and on other test case, I want the passed value to be B. However, when I bind the parameter, both instances are changed.

I intend to do the following
TC1
--SetValueRecording <<<bound variable A = "test"
TC2
--SetValueRecording <<bound variable B = "test2"

but what happens when I change TC2:
TC1
--SetValueRecording <<<bound variable A = "test2"
TC2
--SetValueRecording <<bound variable B = "test2"

Are there any ways I can achieve this?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Passing different values to recording module

Post by odklizec » Tue Apr 11, 2017 9:22 am

Hi,

I don't quite understand what's the problem? You can either create a new parameter in each TC, each with its own value for respective TC. Or you can create a data connector for each TC, from which you can fill the recording module variable. I would strongly recommend to go through this chapter in Ranorex user guide:
http://www.ranorex.com/support/user-gui ... sting.html
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

marlonc
Posts: 6
Joined: Mon Apr 03, 2017 12:29 am

Re: Passing different values to recording module

Post by marlonc » Tue Apr 11, 2017 8:06 pm

Thanks. Im sorry but I may have posted the wrong scenario.
I have recording module that accepts a parameter. Within 1 test case, I want to pass different values for that module.

Code: Select all

TCVerifyForAutocomplete
   RecModuleEnterFields       "entryName"    << contains 15 steps that fills in other fields
   RecModuleDelete                                       << deletes the field values
   RecModuleEnterFields       "en"                  << should autocomplete
   ValidateEntry
When I open the data binding window, it is for the whole test case. How do I go around this to bind different values to RecModuleEnterFields.

marlonc
Posts: 6
Joined: Mon Apr 03, 2017 12:29 am

Re: Passing different values to recording module

Post by marlonc » Tue Apr 11, 2017 8:20 pm

Well SmarFolder does this for me allowing different values passed to two instances of that module in the same test case. Only doable with Ranorex 7. Problem solved! :lol:

Code: Select all

TCVerifyForAutocomplete
   SmartFolder
        RecModuleEnterFields       "entryName"    
   RecModuleDelete                                       
   SmartFolder
        RecModuleEnterFields       "en"             
        ValidateEntry

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Passing different values to recording module

Post by krstcs » Wed Apr 12, 2017 2:10 pm

Actually, any version of Ranorex allows that as long as you either bind the variable to a different data entity, or nest more test cases (which is what you are doing with folders, they are just a new type of test container to go along with test cases).
Shortcuts usually aren't...