Robot: Duplicate Keywords in Library and Resource Keywords

Duplicate Keywords in Library and Resource Keywords

Sometimes, we will meet duplicate keywords in different library orresource keywords. There are two ways we can use it.

Add Library Name beforeKeywords

APCLI User Login OK

[Arguments]

${ip addr}=192.168.0.1

${port}=23

${username}=super

${password}=sp-admin

 

 

RWQAAPCLIKeywords.APCLI Login with Telnet

${ip addr}

${port}

${username}

${password}

 

 

RWQAAPCLIKeywords.APCLI Status Should Be

SUCCESS

 

 

 

 

 

APCLI Get Version OK

 

 

 

 

 

 

 

 

 

   

Set Library Search Order

Set Library Search Order

*libraries

Sets the resolution order to use when a name matches multiple keywords.

The library search order is used to resolve conflicts when a keyword name in the test data matches multiple keywords. The first library (or resource, see below) containing the keyword is selected and that keyword implementation used. If the keyword is not found from any library (or resource), test executing fails the same way as when the search order is not set.

When this keyword is used, there is no need to use the long LibraryName.Keyword Name notation. For example, instead of having

MyLibrary.Keyword

arg

MyLibrary.Another Keyword

 

MyLibrary.Keyword

xxx

you can have

Set Library Search Order

MyLibrary

Keyword

arg

Another Keyword

 

Keyword

xxx

Starting from Robot Framework 2.6.2 this keyword can be used also to set the order of keywords in different resource files. In this case resource names must be given without paths or extensions like:

Set Library Search Order

resource

another_resource

NOTE:

  • The search order is valid only in the suite where this keywords is used.
  • Keywords in resources always have higher priority than keywords in libraries regardless the search order.
  • The old order is returned and can be used to reset the search order later.
  • Starting from RF 2.6.2, library and resource names in the search order are both case and space insensitive.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值