简体   繁体   English

从QTP / vbscript调用Java方法

[英]call java methods from QTP/vbscript

I am working on a Java application which has a custom build java tree, which QTP though able to identify, but not able to use JavaTable methods such as GetCellData. 我正在研究具有自定义构建Java树的Java应用程序,该QTP能够识别但不能使用JavaTable方法(如GetCellData)。

In order to fetch cell data I did some googling and came to know if I am able to directly call the Java method which in my case is getDisplayedtextAt(int, int) then I am able to achieve the task. 为了获取单元格数据,我进行了一些谷歌搜索,然后知道是否可以直接调用Java方法(在我的情况下为getDisplayedtextAt(int,int))可以完成任务。

Does anyone have any idea how can I make a call from QTP to Java methods? 有谁知道如何从QTP调用Java方法?

Every Java test object has a getStatics method , about which the QTP documentation says: 每个Java测试对象都有一个getStatics方法 ,QTP文档对此进行了说明:

Returns the Java object capable of accessing static members (methods and fields) of the specified Java class. 返回能够访问指定Java类的静态成员(方法和字段)的Java对象。

Also, JavaTestObject.Object gives you the native Java (not Windows!) GUI class object instance of the GUI control` that the test object represents. 同样, JavaTestObject.Object为您提供测试对象表示的GUI控件的本机Java(不是Windows!)GUI类对象实例

One of those two pathes are the way to go to call your getDisplayedtextAt method. 这两种路径之一是调用getDisplayedtextAt方法的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM