我有一段SWTBot代码,在我的机器上启动时可以很好地运行,但在Jenkins运行时会失败:
...
SWTBotTreeItemExtension readSchemaProperty =
new SWTBotTreeItemExtension(readProperties.getTreeItem("Schema").widget, readProperties.widget);
readSchemaProperty.click(1);
readSchemaProperty.click(1);
readSchemaProperty.pressShortcut(Keystrokes.DOWN);
...( SWTBotTreeItemExtension是一个自定义类,用于在表格小部件中单击,类似于属性视图中使用的小部件;cf.http://www.eclipse.org/forums/index.php/t/153600/)
测试由Tycho执行。当它由Jenkins启动时没有错误,但点击和击键没有任何影响。当我在命令行中手动启动它时,一切工作正常。
我在某处读到,当Jenkins和Jenkins一起使用SWTBot时会出现“焦点问题”,而且Jenkins是作为服务安装在Windows上的,但我不明白这怎么会导致这种问题,而我的其他测试却毫发无损。感谢所有有建设性的意见。
发布于 2013-07-04 16:44:33
如果Jenkins作为Windows服务运行,它将无法与Bot交互。http://habibbabbles.blogspot.com/2013/06/running-ui-tests-from-jenkins.html
https://stackoverflow.com/questions/15875279
复制相似问题