IBM网站上的一点内容(暂时设为私有)

There are several ways of doing what you are looking to do. Below are a few things you can look into and see if they will work for what you are wanting to do.

1) Use regular expressions - Depending on what properties are different, you can modify the expected values using regular expressions so that RFT will accept multiple inputs for that property. For example, say you have a button and in one UI it says "Click" and in another it says "Click Me!". You could change the corresponding expected value in the object map to a regular expression that matches both values. This will generally work well in situations where the differences between objects is small.

2) Use the dynamic find - If your problem lies in the property types themselves, i.e. having scripts for both java and web UIs, or the differences in your objects are too complex, i.e. testing against different languages, you can use the dynamic find method to get your objects. This route can be very easy to maintain, but requires a good amount of set up time get the properties you want to use and code them into your script or into a separate file that your script reads from. Using this method you could have your script call a factory class to perform the appropriate action depending on what UI you are testing.

3) Use the RFT script helper templates - You can also modify your script helper templates to make the object methods create by RFT public instead of protected. By doing this you can set up your project so that you have "map" scripts which contain the objects you need, and then controller classes that get an object from a map based on the UI you are testing.

 

I'd advise against options 1 and 3:

Option 1 requires too much manual tweaking of object maps.

Option 3 is close to a good solution, but I don't understand why you suggest making the object-access methods in the helpers public. I think he would want the objects to have the same name in each UI's object map... making the object retrieval methods in the helpers public would presumably prevent this. Also, if you have 'map' scripts, why do the objects need to be public in the first place? Only the scripts containing the object map need access to the objects in the map, and then the methods in those scripts for accessing the objects could be public. He had actually come very close to suggesting this solution himself, since he mentioned that he is already wrapping object retrieval in script calls.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值