RF中,同一个关键字存在于多个库中

当Robot Framework中同一个关键字在多个库共存时,未指定库名会导致程序报错。例如,'Get Element Attribute' 关键字在XML和Selenium2Library库中都存在。为避免警告和错误,需要明确指定库名,如'Selenium2Library.Get Element Attribute'或'XML.Get Element Attribute'来调用所需关键字。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当同一个关键字在多个库都存在时,使用时需要加上库名以做区分,否则程序会报错

例如:get element attribute关键字,在XML和Selenium2Library库中都有;

1、不加库名,运行

 

运行后:报错,

[ WARN ] Keyword 'Get Element Attribute' found both from a custom test library 'Selenium2Library' and a standard library 'XML'. The custom keyword is used. To select explicitly, and to get rid of this warning, use either 'Selenium2Library.Get Element Attribute' or 'XML.Get Element Attribute'.

2、加上库名

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值