python - RIDE - 一些图书馆/资源是红色的

标签 python robotframework

我的机器人框架脚本中的一些库/资源是红色的,如下所示: bad script with red marks

而另一个(我从中复制的)看起来还不错: good script

我的工作环境(树)是这样的: working environment/tree

我不明白的是为什么在一个脚本中一切看起来都不错,而在另一个脚本中(看起来几乎一样)一些库/资源是红色的。

我问的主要原因是因为我的 python 脚本 (stability_tests.py) 没有获取我发送的参数(stability_args,见下文)。

my robot framework script

*** 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}

顺便说一句,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)])

最佳答案

你可以试试下面的方法

1)在环境变量中给出绝对路径直到BeAm.beacon

2) 如果1不成功,创建一个环境变量PYTHONPATH并提供到BeAm.beacon

的绝对路径

这应该可以解决您的问题

关于python - RIDE - 一些图书馆/资源是红色的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47429196/

相关文章:

python - 在Robot Framework中,在测试用例拆卸阶段,如何检查当前测试用例是失败还是通过?

python - 使用自定义库运行机器人框架测试用例时,如何解决“"NameError: global name ' x'未定义”错误?

python - 使用 Python 将焦点放在 Windows XP 中的托盘图标上

python - 加速 numpy 条件替换

python - 如何获取 SQL Alchemy 执行的查询的原始 SQL

python - 递归 Excel 文件以从树结构中查找顶级项目

python - Robot Framework 使用 PUDB 调试 python 代码

python - 与 Python 单元测试相关的测试发现意味着什么?

android - 在机器人中将 python 函数作为关键字运行会导致无限循环

testing - selenium2和vncserver或xvfb有什么关系