Page 1 of 1

Module Comments

Posted: Wed Oct 29, 2014 11:55 am
by alina
Hi,

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?)

thanks,

Alina

Re: Module Comments

Posted: Wed Oct 29, 2014 1:31 pm
by krstcs
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
Click_LoginButton

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.

Re: Module Comments

Posted: Wed Oct 29, 2014 9:02 pm
by Support Team
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
Regards,
Bernhard