Revision: 4654
Author: [email protected]
Date: Tue Mar  1 04:55:19 2011
Log: Edited wiki page TestStructure through web user interface.
http://code.google.com/p/robotframework/source/detail?r=4654

Modified:
 /wiki/TestStructure.wiki

=======================================
--- /wiki/TestStructure.wiki    Mon Feb 28 17:30:47 2011
+++ /wiki/TestStructure.wiki    Tue Mar  1 04:55:19 2011
@@ -40,6 +40,31 @@
 }}}
 </td></tr>
 </table>
+
+ * Remember that you can call Robots keyword libraries from python
+
+{{{
+from robot.libraries.BuiltIn import BuiltIn
+
+def do_something(argument):
+    output = do_something_that_creates_a_lot_of_output(argument)
+    outputdir = BuiltIn().replace_variables('${OUTPUTDIR}')
+    write_output(outputdir)
+}}}
+
+
+ * From Robot 2.5 onwards you can get an active library instance also in keyword
+
+{{{
+from robot.libraries.BuiltIn import BuiltIn
+
+def title_should_start_with(expected):
+    seleniumlib = BuiltIn().get_library_instance('SeleniumLibrary')
+    title = seleniumlib.get_title()
+    if not title.startswith(expected):
+        raise AssertionError("Title '%s' did not start with '%s'"
+                             % (title, expected))
+}}}

* Choosing between test suite file and a shared resource file depends from the situation.

Reply via email to