1

我有一段 SWTBot 代码在我的机器上启动时运行良好,但在由 Jenkins 运行时失败:

...
SWTBotTreeItemExtension readSchemaProperty = 
  new SWTBotTreeItemExtension(readProperties.getTreeItem("Schema").widget, readProperties.widget);
readSchemaProperty.click(1);
readSchemaProperty.click(1);
readSchemaProperty.pressShortcut(Keystrokes.DOWN);
...

(SWTBotTreeItemExtension 是一个自定义类,用于单击表格小部件,例如在 Properties 视图中使用的小部件;参见http://www.eclipse.org/forums/index.php/t/153600/

测试由第谷执行。Jenkins启动时没有错误,但点击和击键没有任何效果。当我在命令行上手动启动它时,一切正常。

我在某处读到,在将 SWTBot 与 Jenkins 一起使用时存在“焦点问题”,并且 Jenkins 作为服务安装在 Windows 上,但我不明白这会如何导致这种问题,同时让我的其余测试安然无恙。感谢所有建设性意见。

4

1 回答 1

0

如果 Jenkins 作为 Windows 服务运行,它不能与 Bot 交互。 http://habibbabbles.blogspot.com/2013/06/running-ui-tests-from-jenkins.html

于 2013-07-04T08:44:33.287 回答