請幫忙理解。在機器人框架中使用python腳本
我有腳本(SplitModule.py):
from robot.api.deco import keyword
@keyword('Split Function')
def splitfunction(string):
print "atata"
new_list = string.split(",")
return new_list
和機器人的框架腳本的test.txt:
*** Settings ***
Library DiffLibrary
Library String
Library OperatingSystem
Library Collections
Library SplitModule.py
*** Test Cases ***
Example of calling a python keyword that calls a robot keyword
Split Function ${services}
但是我有功能的問題,有出:
=============================================== ===============================機器人 ================= ========== ================================================== = Robot.Check服務 ============================================ ==================================調用一個調用機器人關鍵字的python關鍵字的示例
|失敗|找不到名稱爲'Split Function $ {services}'的關鍵字。 ------------------------------------------------- ----------------------------- Robot.Check服務
|失敗| 1關鍵測試,0通過,1失敗1測試總數,0通過,1 失敗 ============================== ================================================機器人
|失敗| 1關鍵測試,0通過,1失敗1測試總數,0通過,1 失敗 ============================== ================================================輸出: /opt/robot/logs/output.xml日誌:/opt/robot/logs/log.html 報告:/opt/robot/logs/report.html
什麼問題?感謝
它的工作。謝謝 –