>>> from robot.libraries.BuiltIn import BuiltIn>>> s2l = BuiltIn().get_library_instance('Selenium2Library')
Traceback (most recent call last): File "<pyshell#19>", line 1, in <module> s2l = BuiltIn().get_library_instance('Selenium2Library') File "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 2922, in get_library_instance return self._namespace.get_library_instance(name) File "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 70, in _namespace return self._context.namespace File "C:\Python27\lib\site-packages\robot\libraries\BuiltIn.py", line 65, in _context raise RobotNotRunningError('Cannot access execution context')RobotNotRunningError: Cannot access execution context import pdb,sys; pdb.Pdb(stdout=sys.__stdout__).set_trace()
Ugh
The answers depends, to your original question, do you want to run S2L functions, when RF is running or do you want to run S2L functions when RF is not running? Both of them are possible, but requires quite different setup.
-Tatu
Send from my mobile
--
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 http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
> import library Selenium2Library< keyword: import library Selenium2Library! Importing test library 'Selenium2Library' failed: ImportError: cannot import name GLOBAL_VARIABLES
Traceback (most recent call last): File "C:\Python27\lib\site-packages\Selenium2Library\__init__.py", line 2, in <module> from keywords import * File "C:\Python27\lib\site-packages\Selenium2Library\keywords\__init__.py", line 1, in <module> from _logging import _LoggingKeywords File "C:\Python27\lib\site-packages\Selenium2Library\keywords\_logging.py", line 3, in <module> from robot.variables import GLOBAL_VARIABLESPYTHONPATH: C:\Python27\Scripts C:\Windows\SYSTEM32\python27.zip C:\Python27\DLLs C:\Python27\lib C:\Python27\lib\plat-win C:\Python27\lib\lib-tk C:\Python27 C:\Python27\lib\site-packages C:\Python27\lib\site-packages\win32 C:\Python27\lib\site-packages\win32\lib C:\Python27\lib\site-packages\Pythonwin C:\Python27\lib\site-packages\wx-2.8-msw-unicode>