qtp descriptive programming multiple language(多语言支持)

本文介绍了一种在不同语言环境下正确识别网页元素的方法。通过使用描述性编程,并结合特定字符来分隔不同语言的文本,可以有效地解决跨语言环境中元素定位的问题。此方法能够帮助开发者编写更加灵活且易于维护的代码。

so easy,

1,use the descriptive programming;

2,use the | chracter to seperate the different language text ,so it can found the different language text ,if it found then it recognize the object correctly ;

 

for example :

there is a web element ,in chinese it shows the text as :选择客户名称通过过滤器,but in english it shows the text is:Select customer by filter

  set objCustomerfilter=objPage.webelement("innertext:=Select customer by filter|选择客户名称通过过滤器 ","html tag:=A")

ok, now you can use the above code to make your code supported different language issues.enjoy it :) 



本文转自hcy's workbench博客园博客,原文链接:http://www.cnblogs.com/alterhu/p/3522323.html,如需转载请自行联系原作者。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值