在QTP中,如何检查对话框是否已经打开?

发布于 2024-09-07 01:54:29 字数 325 浏览 3 评论 0原文

我一直在使用以下代码来检查对话框是否已打开

If  Window(window_name).Dialog(dialog_name).Exist = False 
    Then '' //here qtp waits..
    Window(window_name).WinMenu("Menu").Select menu_name
End If

此代码是为了避免在每次运行代码期间重新打开相同的对话框。但 qtp 运行等待大约 10 - 15 秒 &然后进入下一步。我们怎样才能避免这种情况呢?

如果对话框未打开,则单击菜单以打开对话框。

I have been using the following code to check whether a dialog is already open

If  Window(window_name).Dialog(dialog_name).Exist = False 
    Then '' //here qtp waits..
    Window(window_name).WinMenu("Menu").Select menu_name
End If

This code is to avoid reopening the same dialog during each run of the code. But the qtp run waits about 10 - 15 seconds & then goes to next step. in what way we can avoid this?

If the dialog is not open, then the menu will be clicked to open the dialog.

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

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

发布评论

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

评论(2

幸福还没到 2024-09-14 01:54:29

Exist 属性接受等待对象存在的时间值。

If Window(window_name).Dialog(dialog_name).Exist(60) = False

The Exist property accepts a value of how long to wait for the object to exist.

If Window(window_name).Dialog(dialog_name).Exist(60) = False
夜吻♂芭芘 2024-09-14 01:54:29

提到的方法很好。你也可以尝试这个方法。

If (Window(window_name).Dialog(dialog_name)
  .winbutton(Btn_name).Getroproperty("abs_x"))

如果对象存在则返回 true,否则返回 false。

The method mentioned is good. You can also try this method.

If (Window(window_name).Dialog(dialog_name)
  .winbutton(Btn_name).Getroproperty("abs_x"))

This returns true if the object exists if not it returns false.

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