from robot.libraries.BuiltIn import BuiltInclass ScDocTestLibrary():def __init__(self):sc = BuiltIn().get_library_instance("ScConnector")self.inputDirectory = sc.getInputDir()
X:\robot-framework-test\testlibs\doc>python -m robot.libdoc ..\ScDocTestLibrary.py scdotest.htmlInitializing test library 'ScDocTestLibrary' with no arguments failed: RobotNotRunningError: Cannot access execution contextTraceback (most recent call last):File "X:\robot-framework-test\testlibs\ScDocTestLibrary.py", line 11, in __init__sc = BuiltIn().get_library_instance("ScConnector")File "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 2964, in get_library_instancereturn self._namespace.get_library_instance(name)File "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 75, in _namespacereturn self._get_context().namespaceFile "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 70, in _get_contextraise RobotNotRunningError('Cannot access execution context')Try --help for usage information.X:\robot-framework-test\testlibs\doc>
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Ugh
I usually try to have a meaningful default value. If meaningful value cannot be guaranteed, I tend to use Python None and raise an meaningful exception when keyword is used. The other option is give the arguments from command line[1], the examples are at the end of the chapter 5.1.
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#general-usage
--
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.