首页 文章

在UFT中录制时识别对象的所有属性

提问于
浏览
0

我正在寻找一种方法来保存 all 我在uFT测试时单击的每个对象的对象属性 . 基本思想是在记录属性时覆盖捕获属性的函数,并使其将所有属性转储到excel中 .

这样的东西已经可以使用,或者你知道我怎么能这样做吗?

1 回答

  • 0

    1. You could reconfigure UFT's object configuration ("Tools"/"Object configuration") so that for all the test object classes you are interested in, all available properties are mandatory properties. (要在该对话框中保留更改,请使用"Generate script..."按钮,然后在开始录制会话之前执行生成的脚本 . )

    To export to Excel, you could export the resulting OR to XML, and transform that into an importable form. 这可能非常复杂,因为OR XML模式并不是非常简单 .

    2. Alternatively, you could create custom object test classes using Extensibility, and customize it so it a) defines all the TO properties to be mandatory and b) writes the "learned" properties to an Excel-compatible format during recording. 可扩展性允许您执行a)和b),但获得可扩展性设置和运行的开销并不低 .

    3. Finally, you could write a "Dump dialog" script that enumerates all GUI objects of a dialog as test objects, and writes the collection returned by getTOProperties to an Excel-compatible file. 但是,您如何枚举对象?如果使用 .ChildObjects ,则会得到一个强烈简化的层次结构 . 如果您使用DOM,则您是特定于IE的 . 如果它是Java应用程序,您需要坚持 .ChildObjects ,或使用本机Java API(通过 .Object ) .

    最重要的是,知道为什么要将所有GUI对象的TO属性值转储到Excel开始时会更有趣 . I doubt your goal is worth the trouble, and effort, involved in achieving this.

相关问题