51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1809|回复: 4
打印 上一主题 下一主题

[原创] 有个脚本不太明白的地方

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-6-21 19:13:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
有一段脚本:
'Just an example for getting a Java array from some object

set comps = JavaWindow("SwingSet").JavaInternalFrame("Internal Frame Generator").Object.getComponents()
'getComponents()有这个方法么,我在JAVA插件的帮助文件里没看到有这个方法。

'This is the actual workaround - notice the special undocumented command mic_arr_get

set currComp = comps.mic_arr_get(0)

'Now that we have the item we want from the array, let’s print it

msgbox currComp.toString()


下面说的这些方法是从那里来的。。。
According to Tsachi there are two such methods:

mic_arr_get – Receives an index and returns the item at that index in the array. The returned item will always be an object (so we have to use .ToString).
mic_arr_set – Receives an index and an object and sets the appropriate item in the array.

There’re also more sophisticated versions for mic_arr_get: instead of returning an object and then turning it into a sting (or an integer, etc), you can perform both actions in a single action by using these specialized methods:

    mic_arr_get_int : will return the data as an integer
    mic_arr_get_char : will return the data as a single char
    mic_arr_get_double : will return the data as a double (real) number
    mic_arr_get_long : will return the data as a long number
    mic_arr_get_short : will return the data as a short number
    mic_arr_get_byte : will return the data as a byte number
    mic_arr_get_boolean : will return the data as a boolean

Similarly, you can use the specialized methods for inserting specific data-types into an array:

    mic_arr_set_int
    mic_arr_set_char
    mic_arr_set_double
    mic_arr_set_long
    mic_arr_set_short
    mic_arr_set_byte
    mic_arr_set_boolean
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-6-21 23:11:42 | 只看该作者
问题是?

QTP的帮助文档其实并没有很全面地把所有内容记录,有些函数、对象都没有公布出来,例如DeviceReplay对象:
http://blog.csdn.net/Testing_is_ ... /06/02/2504745.aspx
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2008-6-22 08:45:17 | 只看该作者
那么我如何才能知道那些函数那些方法是可以用而没有公布出来的呢,谢谢
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2008-6-22 16:23:07 | 只看该作者
我一般是看到别人用了才知道有这些可用的函数。

推荐本人新书《QTP自动化测试实践》,该书的详细目录见:
http://blog.csdn.net/Testing_is_ ... /06/22/2574837.aspx
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2008-6-22 20:17:42 | 只看该作者
恩,现在LR已经出了比较多的书了,在QTP书不太多的情况下,这本书看目录还不错。。NET方面讲的比较多,要是能在多讲点JAVA、ORACLE一些典型插件的使用和脚本开发就更好了。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-28 05:34 , Processed in 0.078334 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表