Howto pass same parameter along rxrec, UserCodeCollection...

Best practices, code snippets for common functionality, examples, and guidelines.
User avatar
_KK_
Posts: 24
Joined: Tue Nov 21, 2017 12:51 pm

Howto pass same parameter along rxrec, UserCodeCollection...

Post by _KK_ » Tue Dec 19, 2017 1:06 pm

Hello Forum,

the help did not have suitable results for me to solve my task.

Dont know how to automate the following workflow with DataDriven Parameter using RecordModule, UserCodeCollection and UserCodeMethod in a RecordModule:

I am missing a mechanism similiar to "InsertNewModuleVariable" in UserCodeModule, but for UserCodeCollection/UserCodeMethod!

What has to be automated (the flow):
The UI has a "custom" keyboard (touch screen) which is using for user entries.
The value of this keyboard is written after completing in a chain along and at least into a "certain" register of a PLC.
The Automation has to verify that the proper value was really written into the PLC (read it out and compare it using Validation class of Ranorex).

The following Parameters should be considered to use as data driven test:
Name of the Register in PLC (e.g. IoPath)
Values to be entered (Keyboard "sequence" is not possible because the custom-keyboard is the bottleneck!)

Structure of the testsoftware (my approach so far):
- RecordModule ("addressid" based for Keyboard entries, one after one, eg. 2920333555,456 or xyz, -3666 etc.)
- UserCodeMethod to connect to the PCL
- UserCodeMethod to read out the Content of the Register from the PLC
- Ranorex Validation class for verification of the written value (inside the UserCodeMethod)


For testing with equivalence class the same Register has to be tested with Minvalue, Maxvalue etc.
The Name of the Register has to be taken out of e.g. csv-adapter for DataDriven tests.


Thanks in advance for any help (e.g. link to Rx documentation or code snippets).

BR

Klaus

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

Re: Howto pass same parameter along rxrec, UserCodeCollection...

Post by odklizec » Tue Dec 19, 2017 1:40 pm

Hi Klaus,

Maybe I'm misunderstanding something, but are you aware that you just need to create a user code method with an argument(s)? If you want to pass something to user code (from data connector), then all you need to do is to create a "string" argument, which must be associated with a module variable, which could be then connected to a test case/smart folder data connector. That's all.
UserCodeArgs.png
UserCodeArgs.png (39.59 KiB) Viewed 369 times
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

User avatar
_KK_
Posts: 24
Joined: Tue Nov 21, 2017 12:51 pm

Re: Howto pass same parameter along rxrec, UserCodeCollection...

Post by _KK_ » Wed Dec 20, 2017 7:54 am

Hi odklizek, thanks for the help.

I use Rx 8.0.0

Maybe I took the wrong way.
When I try to combine UserCode in Recordmodule, I do this with Add new action, UserCode
When there is no library Content, you cant select something (see screenshot).
So I visit the help and created a Collection with some usermethods (the one you can see in the screenshot).

I was not aware that I can create directly a method.
The thing is, when typing a name in you have to leave the line to get afterwards the possibility to create Parameter in that usercode (when you can create Parameters you can see the quotes (), see second screenshot).
It is only a small thing, but shit happens.

Now I have to make the Parameters running with DataSource in my chain (workflow).
Attachments
no args to select.PNG
maybe the ! indicates that you have to leave the line and get back to configure the arguments
no args to select.PNG (8.99 KiB) Viewed 358 times
view different.PNG
cant see the possibility to use arguments because it is a method within a collection
view different.PNG (12.78 KiB) Viewed 358 times