在我的RCP应用程序中,有时某些shell在某些条件下打开,而我想要处理它们。例如:如果文件夹中已存在文件,则覆盖shell将打开。如果文件将打开,我希望覆盖shell。
我已经尝试过了,如果shell的条件是活动的,请参见代码。但是如果条件在swtbot中不起作用。即使覆盖外壳没有打开,它也会尝试点击覆盖外壳上的确定按钮。
请参见代码:
if (swtBot.shell("Overwrite").isActive) {
swtBot.Button("Ok").click(); //This code is every time executing even if Overwrite shell is not opened.
} else {
//doing some other operation
}发布于 2015-03-06 00:34:26
try {
swtBot.Button("Ok").click(); // it will click the button if the appropriate shell is active
} catch(WidgetNotFoundException e) {
//doing some other operation
}https://stackoverflow.com/questions/25600140
复制相似问题