我開始一個新的RobotFramework項目,但我使用mvn插件來管理項目。 我想添加一些python庫(我的電腦上安裝了python),但是當我嘗試使用mvn run命令運行項目時,出現了一些與缺少python庫安裝相關的錯誤。在mvn項目中使用robotframework python庫
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building robot-framework 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- robotframework-maven-plugin:1.2:run (default-cli) @ robot-framework ---
==============================================================================
Acceptance
==============================================================================
[ ERROR ] Error in file 'C:\TEMP\robot3\src\test\robotframework\acceptance\Basic_Test.txt': Importing test library 'RequestsLibrary' failed: ImportError: No module named requests
Traceback (most recent call last):
File "C:\TEMP\robot3\src\test\resources\robotframework\libraries\RequestsLibrary\__init__.py", line 1, in <module>
from RequestsKeywords import RequestsKeywords
File "C:\TEMP\robot3\src\test\resources\robotframework\libraries\RequestsLibrary\RequestsKeywords.py", line 1, in <module>
import requests
PYTHONPATH:
C:\TEMP\robot3\src\test\resources\robotframework\libraries
C:\Users\support\.m2\repository\org\robotframework\robotframework\2.8.1\robotframework-2.8.1.jar\Lib\robot\libraries
C:\Users\support\.m2\repository\org\robotframework\robotframework\2.8.1\robotframework-2.8.1.jar\Lib
C:\Users\support\.m2\repository\org\robotframework\robotframework\2.8.1\Lib
__classpath__
__pyclasspath__/
.
C:\TEMP\robot3
CLASSPATH:
C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\bin\..\boot\plexus-classworlds-2.4.jar
Acceptance.Basic Test
==============================================================================
Basic Test | FAIL |
No keyword with name 'Create Session' found.
------------------------------------------------------------------------------
如果我使用Pybot命令運行項目,一切工作正常。我在使用Maven插件時如何使用Python庫?或者我可以將Pybot命令添加到pom.xml中?
IS要求圖書館在你的路徑?它不是一個內置的庫,必須使用它。 – alpert