Module Comments

Ranorex Spy, Recorder, and Studio.
Posts: 10
Joined: Wed Oct 15, 2014 5:03 pm

Module Comments

Post by alina » Wed Oct 29, 2014 11:55 am


Do youn know if it is possibe to add comments to modules -?

i.e. for the whole script i.e. this module verifies that... blah blah. i understand there is a comments column for each step. But i require a comment for the whole script (somewhere at the top?)



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

Re: Module Comments

Post by krstcs » Wed Oct 29, 2014 1:31 pm

Currently you can only put comments directly on actions inside a module or on modules when they are in a test case. There is no built-in way to add a persistent comment to a module itself that will be displayed outside the module.

You could add a Report.Info action to the start of each module that contains the information you are wanting, but it would only be displayed in the report, not in the test cases.

However, one thing you should be doing is naming the modules for what they do. Also, you should keep the modules as small as possible, preferably only one atomic action (one action a user would take, like clicking a button, or entering text in a field) each. This will solve most of your issue.

For example, if you need to login to a site, you would have the following modules, assuming username and password fields, and clicking a "Login" button.

Enter_UserName ==> Variables: $UserName

Code: Select all

Mouse -> Click -> Left -> Center -> UserNameField
Key -> Shortcut -> 'Ctrl-A' -> UserNameField
Key -> Sequence -> $UserName -> UserNameField
Validate -> Value -> $UserName -> UserNameField
Enter_Password ==> Variables: $Password

Code: Select all

Mouse -> Click -> Left -> Center -> PasswordField
Key -> Shortcut -> 'Ctrl-A' -> PasswordField
Key -> Sequence -> $Password-> PasswordField
Validate -> Value -> $Password-> PasswordField

Code: Select all

Mouse -> Click -> Left -> Center -> LoginButton
Now, you know exactly what each module does, no guessing. And, they are easier to maintain because they are simple. All you have to do is drop them in the test case in the order you need.

This DOES make many more modules, but I have found that this is well worth the effort in the long run.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12167
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Module Comments

Post by Support Team » Wed Oct 29, 2014 9:02 pm

Hi all,

In order to add a comment to a module you can use the XMLDoc Summary. This comment will be shown as mouse hover box in the Ranorex Module Browswer as shown in the image below.
ModuleDescription.jpg (100.28 KiB) Viewed 2300 times