简体   繁体   English

从测试文件(.robot 文件)中删除关键字(.resource 文件)中的参数 - Robot Framework

[英]Parameter deletion in a keyword (.resource file) from a test file (.robot file) - Robot Framework

good afternoon.下午好。

I have the following question: I can delete a parameter contained in a keyword in.resource file, but doing this action in my test.robot file?我有以下问题:我可以删除包含在关键字 in.resource 文件中的参数,但在我的 test.robot 文件中执行此操作? I tried with the Remove From Dictionary, but this keyword works only when i'm the same file...我尝试使用“从字典中删除”,但此关键字仅在我是同一个文件时才有效...

Example:例子:

.resource File .资源文件

*** Keywords ***

Start
    &{BODY}      Create Dictionary
    ...    userSystemName=${USER_SYSTEM_NAME}
    ...    ispbPsp=${ISPB_PSP}
    ...    isSystem=${TRUE}

Set Suite Variable    &{BODY}

.robot File .robot 文件

*** Test Cases ***

    Test Start
          Start

In my test case I want to exclude the "ispbPsp" param before send the request (RequestLibrary).在我的测试用例中,我想在发送请求 (RequestLibrary) 之前排除“ispbPsp”参数。

I can this?这个我可以吗

How?如何?

Thanks very much!!!!!!!非常感谢!!!!!!!

You can use the keyword Remove From Dictionary in a copy of the variable您可以在变量的副本中使用关键字Remove From Dictionary

*** Test Cases ***

Test Start
  Start
  ${bodycopy}=  ${BODY}
  Remove From Dictionary  ${bodycopy}  ispbPsp
  Do Something With  ${bodycopy}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM