我想創建與下面的代碼蟒蛇網絡驅動程序實例創建一個Web驅動程序實例:不能在python
from robot.libraries.BuiltIn import BuiltIn
import Selenium2Library
from Selenium2Library import Selenium2Library
def get_webdriver_instance():
s2l = BuiltIn().get_library_instance("Selenium2Library")
return s2l._current_browser()
,但在內置的()get_library_instance(「Selenium2Library」)我我收到以下錯誤:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/robot/libraries/BuiltIn.py", line 2922, in get_library_instance
return self._namespace.get_library_instance(name)
File "/usr/lib/python2.6/site-packages/robot/libraries/BuiltIn.py", line 70, in _namespace
return self._context.namespace
File "/usr/lib/python2.6/site-packages/robot/libraries/BuiltIn.py", line 65, in _context
raise RobotNotRunningError('Cannot access execution context')
robot.libraries.BuiltIn.RobotNotRunningError: Cannot access execution context
可能有人請幫助我解決這個錯誤
我正在使用pybot命令運行測試,但仍然收到此錯誤 – Madhuri