다음은 testcase 및 suite (__init__.txt
) 파일에서 참조하고있는 resource.txt입니다. 정적 API (RobotLibrary)에 매핑 된 키워드를 실행 한 후 결과를 얻고 결과를 반환하기 위해 동일한 정적 API (RobotLibrary) 모듈에 결과를 전달하고 싶습니다. RobotLibrary가 여러 테스트에서 단일 인스턴스이기 때문에 결과를 RobotLibrary의 상태로 유지하려했으나 작동하지 않았습니다. 결과를 키워드를 통해 반환하고 후속 호출에 인수로 반환하는 것을 신경 쓰지 않습니다.로봇 프레임 워크 어떻게 정적 API에서 메소드를 실행 한 후 결과를 얻을 수 있습니까?
*** Settings ***
Library ${CURDIR}${/}..${/}src${/}RobotLibrary.py
*** Keywords ***
[return] ${result_run}
when the configuration file "${filename}" is used to run the journey
${result_run}= start journey with config ${filename}
when the route has a route code of "${routecode}"
use route code ${routecode}
journey status should be "${status}"
assert journey status ${status}
stop with name "${stopName}" should have an arrival time
assert stop has arrival time ${stopName} ${result}
이것은 작동하지 않았습니다. 다음과 같은 메시지가 콘솔에 표시됩니다.
(acceptance_test)[[email protected] jsf_acceptance_test]# pybot -L TRACE robot-tests/manual/Mandatory-Delayed-S0-Mandatory-Delayed-S1-329-1/
==============================================================================
Mandatory-Delayed-S0-Mandatory-Delayed-S1-329-1 :: Mandatory-Delayed-S0-Man...
==============================================================================
Mandatory-Delayed-S0-Mandatory-Delayed-S1-329-1.Mandatory-Delayed-S0-Mandat...
==============================================================================
Ensure feedback for stop stop0 on route CGXD | FAIL |
Parent suite setup failed:
No keyword with name '${result_run}= start journey with config' found.
------------------------------------------------------------------------------
Ensure feedback for stop stop1 on route CGXD | FAIL |
Parent suite setup failed:
No keyword with name '${result_run}= start journey with config' found.
------------------------------------------------------------------------------
Mandatory-Delayed-S0-Mandatory-Delayed-S1-329-1.Mandatory-Delayed-... | FAIL |
Parent suite setup failed:
No keyword with name '${result_run}= start journey with config' found.
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
==============================================================================
Mandatory-Delayed-S0-Mandatory-Delayed-S1-329-1 :: Mandatory-Delay... | FAIL |
Suite setup failed:
No keyword with name '${result_run}= start journey with config' found.
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
==============================================================================
Output: /home/pycharm/jsf_acceptance_test/output.xml
Log: /home/pycharm/jsf_acceptance_test/log.html
Report: /home/pycharm/jsf_acceptance_test/report.html
잘 모르시는 방법에 대해 잘 모르겠습니다. 저는 로봇 프레임 워크에 비교적 익숙하지 않으며 문서에서 이에 대한 답변을 찾기가 어렵습니다. 누구든지이 문제에 대한 아이디어가 있습니까? 필요한 경우 더 많은 정보로 질문을 업데이트 해 드리겠습니다. 건배.