简体   繁体   English

检查是否在RCPTT中打开了一个窗口

[英]check that a window is opened in RCPTT

I want to check if after some actions, a window is opened. 我想检查一下是否经过一些操作后是否打开了一个窗口。 The window name is "Help - Test". 窗口名称为“帮助-测试”。 Below is my code: 下面是我的代码:

with [get-window "Help - Test"] {
    get-property "isEnabled()" | equals true | verify-true
    get-property "isVisible()" | equals true | verify-true
}

when running the test I get error The Window "Help - Test" could not be found. 运行测试时出现错误找不到“帮助-测试”窗口。

Also I tested the Eclipse help to check that the help menu is opened after Tips and Tricks and same problem: 我还测试了Eclipse帮助,以检查在“技巧和窍门”以及相同的问题之后是否打开了帮助菜单: EC

Note: I want to check that the help menu from eclipse is opened. 注意:我想检查eclipse的帮助菜单是否已打开。

The expression 表达方式

get-window "Help - Test"

is the test itself. 是测试本身。 No need for additional property getters. 无需其他属性获取器。 If RCPTT can not find the window then it is either not there (test case found a real problem) or it checks too early; 如果RCTPT无法找到该窗口,则它要么不存在(测试用例发现了一个真正的问题),要么检查得太早; before the window is rendered. 在渲染窗口之前。

If the latter then things get a little complicated, you could wait or wait-until-eclipse-is-ready or place the action into a try section. 如果后者使事情变得有些复杂,则可以waitwait-until-eclipse-is-ready或将操作放入try部分。

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

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