Run recording module based on get value

Best practices, code snippets for common functionality, examples, and guidelines.
armstronghm24
Posts: 42
Joined: Tue Dec 20, 2016 10:16 pm

Run recording module based on get value

Post by armstronghm24 » Tue Nov 27, 2018 9:05 pm

Hi,
I would like to get a value from my application and run a certain recording module only if the value I am retrieving from my application matches a value from another variable that I am assigning through data binding. Do I need to use a code module? If so, does anyone have any examples?
Last edited by armstronghm24 on Thu Nov 29, 2018 3:33 pm, edited 1 time in total.

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

Re: Run recording module based on get value

Post by odklizec » Wed Nov 28, 2018 9:18 am

Hi,

In my opinion, the only way, how to achieve something like this code-lessly, is using Test Suite conditions:
https://www.ranorex.com/help/latest/ran ... ons-rules/

Basically, you will have to create a recording module, which will get the value, store it in a Global/TestCase/SmartFolder parameter, and then bunch of smart folders (as many as you have the modules you want to conditionally run), with condition and rules, and which will contain the recordings you want to run (based of the obtained value). The structure of the test suite should look like this:
[TestCase_1] <- here create a TC parameter, to store the value obtained later
...
|_GetValueRecMod <-- here you obtain the value and store it in TC parameter (by binding the rec. mod. variable to TC parameter)
|_[SmartFolder_A] <-- condition, evaluating TC parameter. If value match your expectation, smart folder and its content is run.
| |_RecMod_A
|_[SmartFolder_B]
| |_RecMod_B
|_[SmartFolder_C]
|_RecMod_C
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