【问题标题】:How to remove double-quotes in embedded arguments in robot framework while passing it?如何在传递时删除机器人框架中嵌入参数中的双引号?
【发布时间】:2019-09-12 13:09:15
【问题描述】:

我们将如何在传递机器人名声时删除嵌入参数中的""

*** Keywords ***

"${abc}" place an outgoing call to "{xyz}" by using "{xyz_name}"
    ${result}  Set variable  "${abc}"
    Log  ${result}
    ${xyz}  Set variable  "${xyz}"
    Run keyword if  ${result}=="${abc}"  xyz Initiated Sign in
    ...  ELSE  abc Initated Sign in
    Log  "${abc}" initiated call request to "${xyz}"
    Click Element  com.gmail:id/action_bar_search_action
    Sleep  10s
    Input Text  com.gmail:id/search_src_text  "${xyz_name}"
    Wait Until Keyword Succeeds  1m  5s  Click Element  com.gmail:id/search_result_item_container
    Sleep  10s
    Log  "${abc}" placing call to "${xyz}"

【问题讨论】:

  • “反逗号”是指“引号”吗?
  • @BryanOakley 是的

标签: python python-2.7 robotframework


【解决方案1】:

除非您要求,否则机器人不会添加引号。在关键字的开头,${abc}${xyz} 将没有引号字符。

您在此处明确添加引号:

${result}  Set variable  "${abc}"
${xyz}  Set variable  "${xyz}"

如果您不想要引号,请不要添加引号:

${result}  Set variable  ${abc}
${xyz}  Set variable  ${xyz}

【讨论】:

    猜你喜欢
    • 2019-07-25
    • 1970-01-01
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    • 2015-09-02
    • 2021-04-09
    • 2014-09-22
    • 2012-10-09
    相关资源
    最近更新 更多