Eclipse rcp 如何使用RCPTT检查Eclipse RCP中的窗口是否打开

Eclipse rcp 如何使用RCPTT检查Eclipse RCP中的窗口是否打开,eclipse-rcp,eclipse-rcptt,Eclipse Rcp,Eclipse Rcptt,我在RCPTT中开发了一个ECL脚本,用于测试RCP应用程序。在测试过程中,它会设置一些设置并保存。当测试按“OK”时,会打开一个信息窗口,通知用户此更改需要重建项目 我的问题是,此窗口不会始终显示。如果在测试运行的工作区中,此窗口已经打开,并且设置了选项“Remmenber my decision”,那么它将不会打开 我想在测试中加入一个if来处理这两种情况。应该是这样的: if [/* what can i put here ?*/] { get-window Settings |

我在RCPTT中开发了一个ECL脚本,用于测试RCP应用程序。在测试过程中,它会设置一些设置并保存。当测试按“OK”时,会打开一个信息窗口,通知用户此更改需要重建项目

我的问题是,此窗口不会始终显示。如果在测试运行的工作区中,此窗口已经打开,并且设置了选项“Remmenber my decision”,那么它将不会打开

我想在测试中加入一个if来处理这两种情况。应该是这样的:

if [/* what can i put here ?*/] {
    get-window Settings | get-button Yes | click
}
with [get-window Settings] {
    get-property "isEnabled()" | equals true | verify-true
    get-property "isVisible()" | equals true | verify-true
}
如何编写这样的条件?

如果[获取窗口设置|验证为真]或[不获取窗口设置|验证为错误],我可以执行类似的操作吗

编辑:通过使用“记录片段”工具,我得到了如下结果:

if [/* what can i put here ?*/] {
    get-window Settings | get-button Yes | click
}
with [get-window Settings] {
    get-property "isEnabled()" | equals true | verify-true
    get-property "isVisible()" | equals true | verify-true
}

你在我的情况下使用的是哪种财产?启用、可见或同时启用?

在以下情况下使用try-catch:

try {
    get-window Settings | get-button Yes | click
} -catch {
    // Verify that the window was missing (and not some other problem)
    verify-error -command {get-window Settings}
}

在以下情况下使用try-catch:

try {
    get-window Settings | get-button Yes | click
} -catch {
    // Verify that the window was missing (and not some other problem)
    verify-error -command {get-window Settings}
}

你才是真正的最有价值球员!谢谢你,这很好用,你是真正的MVP!谢谢你,这很好用