QTP 可见性问题,有一个奇怪的解决方案

发布于 2024-09-25 03:41:12 字数 378 浏览 1 评论 0原文

我正在 QTP 上测试 Java Web 应用程序。在一个屏幕中,并非所有字段最初都是可见的(即:它们位于“首屏下方”),因此:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Set "bob"

导致发生未指定的错误。

但如果我稍微改变一下:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Object.SetText "bob"

它工作得很好。为什么?

I'm testing a Java web application on QTP. In one screen, not all fields are visible initially (ie: they're 'below the fold'), so this:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Set "bob"

Causes an unspecified error to occur.

But if I change it slightly, to:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Object.SetText "bob"

It works fine. Why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苏别ゝ 2024-10-02 03:41:12

如果开发者设置的JavaEdit Box对象属性与其他类似对象不同。因此必须以这种方式完成。

有很多实例,例如使用 SetCellData 进行编辑操作时,Java 表的一个单元格由值设置,而对于同类操作,通常我们使用 Type / SendKey 方法。

If the object Properties for the JavaEdit Box which is set by the Developers is different from other similar objects. hence it has to be done in that way.

There are many instance like where one cell of the Java Table is set by the value using SetCellData for the Edit operation and for a same kind operation usually we use Type / SendKey methods.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文