Transfer of parameters

Ranorex Spy, Recorder, and Studio.
kathrin
Posts: 11
Joined: Wed Mar 15, 2017 11:27 am

Transfer of parameters

Post by kathrin » Tue Apr 10, 2018 12:29 pm

Hi everyone :),

my test case is composed as follows:

Code: Select all

- open mask 1
- SmartFolder 1 (3 iterations)
      - order something
- close mask 1
- open mask 2
- Smartfolder 2 (3 iterations)
      - View Order
      - read value
- Close mask 2
- Smartfolder 3 (3 iterations)
      - validate value
All smartfolders access the same SQL DataContext.

My problem now is that the values ​​read out in Smartfolder 2 are no longer available in Smartfolder 3.

Can I somehow achieve that?

Many Thanks :)
K
-----------------------
:arrow: Ranorex 8.1 & Ranorex 8.2
:arrow: Ranorex Certified Professional (01/2017)
:arrow: ISTQB Certified Tester Foundation Level (07/2018)

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

Re: Transfer of parameters

Post by odklizec » Tue Apr 10, 2018 12:58 pm

Hi,

The easiest solution is to create a global parameter(s) at test suite level. Then bind the global parameter(s) to a module variable from smart folder 2. This way you can store the obtained value at place, which is accessible from smart folder 3. Then you simply have to create a module variable in smart folder 3 and bind it with global parameter, which contains the value obtained in smart folder 2. Hope this helps?
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

kathrin
Posts: 11
Joined: Wed Mar 15, 2017 11:27 am

Re: Transfer of parameters

Post by kathrin » Tue Apr 10, 2018 2:24 pm

Hi,
I'm not sure if that helps.
The point is that I select one value each in the iterations. That means I would need three (or number of iterations) different global parameters. But I can not bind these to a specific iteration of the Smartfolder 2.
Or do I miss something?

So for me, the question would be how to prevent the modified data context from being reset within the test case.

K
K
-----------------------
:arrow: Ranorex 8.1 & Ranorex 8.2
:arrow: Ranorex Certified Professional (01/2017)
:arrow: ISTQB Certified Tester Foundation Level (07/2018)

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

Re: Transfer of parameters

Post by odklizec » Tue Apr 10, 2018 2:56 pm

Ah sorry, I overlooked the smart folders are iterated. Well, I personally would do validation directly in smart folder 2, instead of separately reading data in one smart folder and then validating them in another smart folder.

If you, from whatever reason, must stick with current test design, then your only chance is to save obtained data to file/db and then load and validate them in smart folder 3. But in my opinion, the easiest way is to validate each iteration of smart folder 2 directly, instead of doing the validation in a separate loop.
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

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: Transfer of parameters

Post by tvu » Tue Apr 10, 2018 11:18 pm

I created a user code module file that simply declared static variables. I think reference those variables from another user code module.

For example, you will have a file called ParameterPassing.cs that declares the following:

Code: Select all

public static List<string> myValues = null;
Then in your Smart Folder 2 > ReadValue.cs file, you write to that static variable or append to it. Of course, you must initialize it first if you're appending:

Code: Select all

ParameterPassing.myValues = listOfReadStringValues;
Then in your Smart Folder 3 > ValidateValues.cs file, you read the static variable:

Code: Select all

foreach (string s in ParameterPassing.myValues)
{
    // Validate values
}
The ParameterPassing.cs file must be run in the parent test container before Smart Folder 2. In your example, it must be run in the Test Suite setup phase.

Hope that helps.

kathrin
Posts: 11
Joined: Wed Mar 15, 2017 11:27 am

Re: Transfer of parameters

Post by kathrin » Wed Apr 11, 2018 12:28 pm

Hi,
I do not want to hide my parameters somewhere in the background.
In the end, no one can see what value is filled by where.

I will cache my read data from Smartfolder 2 as a test case parameter and
read it again at the beginning of Smartfolder 3.
But I still find that the behavior of the Smartfolder is "wrong" at the point.
Maybe I should suggest this with Ranorex UserVoice.

K