传递时如何在机器人框架的嵌入式参数中删除双引号?

时间:2019-04-23 10:55:41

标签: python python-2.7 robotframework

我们如何在传递过程中删除机器人成名作品中嵌入参数中的""

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

1 个答案:

答案 0 :(得分:4)

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

您在此处明确添加引号:

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

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

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