Revision: 3038
Author: janne.t.harkonen
Date: Tue Apr 20 00:45:39 2010
Log: some more examples
http://code.google.com/p/robotframework/source/detail?r=3038
Modified:
/trunk/doc/userguide/src/CreatingTestData/CreatingTestCases.txt
=======================================
--- /trunk/doc/userguide/src/CreatingTestData/CreatingTestCases.txt Fri Apr
16 04:15:39 2010
+++ /trunk/doc/userguide/src/CreatingTestData/CreatingTestCases.txt Tue Apr
20 00:45:39 2010
@@ -134,24 +134,47 @@
'''''''''''''''
If a keyword accepts arguments that have default values, it is also
possible to
-give the arguments using named argument syntax, 'argname=value'. This is
especially
-useful if a keyword accepts multiple arguments that have default values.
-
-Consider using keyword `Start Process` from OperatingSystem library which
takes
-following arguments: `command, stdin=None, alias=None`. Using named
arguments
-it is possible to set `alias` wihtout specifying `stdin`:
+give the arguments using named argument syntax, 'argname=value'. This is
+especially useful if a keyword accepts multiple arguments that have default
+values.
+
+This syntax can be used with user keywords and in importing test libraries
and
+using keywords from test libraries that are implemented with Python and
that
+are not using the `dynamic library API`_
+
+Following table demonstrates using named arguments in different scenarios:
.. table:: Named argument examples
:class: example
+
+--------------+-----------------+----------------------+----------------------------+
+ | Setting | Argument | Argument |
Argument |
+
+==============+=================+======================+============================+
+ | Library | Telnet | prompt=$
| |
+
+--------------+-----------------+----------------------+----------------------------+
+
+.. table::
+ :class: example
+
+--------------+-----------------+----------------------+----------------------------+
| Test Case | Action | Argument |
Argument |
+==============+=================+======================+============================+
| Example | Start Process | ${process name} |
alias=MyAlias |
+--------------+-----------------+----------------------+----------------------------+
-
-This syntax can be used with user keywords and test libraries that are
implemented
-with Python and that are not using the `dynamic library API`_.
+ | Example | My User Keyword | arg2=Hello |
arg3=World |
+
+--------------+-----------------+----------------------+----------------------------+
+
+.. table::
+ :class: example
+
+
+--------------+-----------------+-----------+-----------------+-----------------+
+ | Keywords | Action | Argument | Argument |
Argument |
+
+==============+=================+===========+=================+=================+
+ | User Keyword | [Arguments] | ${arg1} | ${arg2}=default |
${arg3}=default |
+
+--------------+-----------------+-----------+-----------------+-----------------+
+ | ... | | |
| |
+
+--------------+-----------------+-----------+-----------------+-----------------+
+
.. note:: Using named arguments only works with Robot Framework 2.5 or
newer.
--
Subscription settings:
http://groups.google.com/group/robotframework-commit/subscribe?hl=en