Re: How to comment set of keywords framed in Test Case.

3,785 views
Skip to first unread message

Pekka Klärck

unread,
Jan 11, 2013, 7:22:26 AM1/11/13
to sakthi...@gmail.com, robotframe...@googlegroups.com
2013/1/11 Sakthivel P <sakthi...@gmail.com>:
>
> In Robot Framework, How to comment a set of keywords framed in Test Case.
>
> For single line i use to comment as '#'.

There is no real support for block comments, so you basically need to
comment all lines individually with '#'.

With larger blocks you could use Robot's feature that it ignores
tables it cannot recognize at parsing time. For example this has only
two tests:

*** Test Cases ***
My test
My keyword

*** Ignored ***
My ignored test
My ignored keyword

*** Test Cases ***
My second test
My keyword

*** Comment ***
Also this stuff is ignored

*** Keywords ***
My keyword
No operation


Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

mb963

unread,
Mar 23, 2015, 2:49:31 PM3/23/15
to robotframe...@googlegroups.com, sakthi...@gmail.com
Thank you for your response .peke. When I create a table *** Comment ***, the text is commented out, however when the script is saved, I run into a "Can not apply changes from Txt Editor - Error: Data sanity check failed! Reset changes?" and the changes are reverted. Please advise.

MB

nnc

unread,
Mar 23, 2015, 3:09:49 PM3/23/15
to robotframe...@googlegroups.com
test

N.T.

unread,
Mar 24, 2015, 12:50:45 AM3/24/15
to robotframe...@googlegroups.com
If you put the keyword Comment just before the keyword it should work.

if you use RIDE you can just right-click and click "Comment Row" and it will do it for you. 

mb963

unread,
Mar 25, 2015, 11:08:47 AM3/25/15
to robotframe...@googlegroups.com
Using the Keyword comment before keyword(s) reverted the changes, however I'll go back to commenting the rows from Ride editor.

Thanks N.T.
Reply all
Reply to author
Forward
0 new messages