我的机器人框架脚本中的一些库/资源是RED,如下所示: bad script with red marks
虽然其他人(我从中复制过)看起来不错: good script
我的工作环境(树)看起来像这样: working environment/tree
我不明白为什么在一个脚本中一切看起来都很好而在另一个脚本中(看起来几乎相同),一些图书馆/资源是RED。
我问的主要原因是因为我的python脚本(stability_tests.py)没有得到我发送的参数(steady_args,见下文)。
*** Settings ***
Force Tags Critical template Conf=3 isTor=0 isSanity=0
headless rcmd
Library BeAm.beacon.tests.BeaconTesting WITH NAME
BeaconTesting
Library Collections
Library BeAm.beacon.stability_tests
Library BeAm.beacon.tests
Resource ../../BeAm/beacon/settings.txt
Resource ../../BeAm/settings.txt
Resource ../../BeAm/local_settings.txt
*** Test Cases ***
Create Test Object
[Tags] must
${TEST} = BeaconTesting.Get Beacon Test 3
Set Suite Variable ${TEST} ${TEST}
Prepare Beacon Server
[Tags] prpr
BeaconTesting.Change Mss Value ${None}
BeaconTesting.Prepare Server ${TEST}
Beacon Stability
[Tags] stability
${stability_args} = Create Dictionary
Set To Dictionary ${stability_args} RANDOM_BEACON_TYPES False
Set To Dictionary ${stability_args} TIME_GAP 0.3
Set To Dictionary ${stability_args} STRESS_TEST_NUM_OF_REQ 20
Set To Dictionary ${stability_args} WORKERS 2
stability workers ${TEST} &{stability_args}
BTW,python脚本包括stability_workers函数。
def stability_workers(RANDOM_BEACON_TYPES=True, TIME_GAP=60, STRESS_TEST_NUM_OF_REQ=100000, WORKERS=25):
s = NewStressTest(RANDOM_BEACON_TYPES, float(TIME_GAP), int(WORKERS), int(STRESS_TEST_NUM_OF_REQ)])
答案 0 :(得分:1)
您可以尝试以下方法
1)在环境变量中给出绝对路径,直到 BeAm.beacon
2)如果1未成功,请创建一个环境变量PYTHONPATH并提供绝对路径,直到 BeAm.beacon
这可以解决您的问题