【问题标题】:Infix arguments keyword in pythonpython中的中缀参数关键字
【发布时间】:2018-07-06 17:33:12
【问题描述】:

我想在python中写带中缀参数的关键字,可以吗?

*** Keywords ***
Set ${var} on device
    set samething on device  samething=${var}

我可以在 python 中的设备上编写 Set ${var} 吗?

【问题讨论】:

标签: python robotframework


【解决方案1】:
from robot.api.deco import keyword

@keyword('Add ${quantity:\d+} Copies Of ${item} To Cart')
def add_copies_to_cart(quantity, item):
    # ...
*** Test Cases ***
My Test
    Add 7 Copies Of Coffee To Cart

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#embedding-arguments-into-keyword-names

【讨论】:

    猜你喜欢
    • 2013-08-16
    • 1970-01-01
    • 1970-01-01
    • 2011-02-14
    • 1970-01-01
    • 2012-10-30
    • 2010-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多