jenkins运行selenium 测试 不显示浏览器 解决方法

玩技站长 经验总结评论952字数 979阅读模式

jenkins执行selenium 测试 浏览器不显示解决方法

The web browser doesn't show while run selenium test via jenkins

原因:因为jenkins是用windows installer 安装成 windows的服务了,那么jenkins是一个后台服务,所以跑selium cases 的时候不显示浏览器文章源自玩技e族-https://www.playezu.com/13440.html

解决办法文章源自玩技e族-https://www.playezu.com/13440.html

Step 1. Control Panel(控制面板) -> Administrative Tools(管理工具) -> Services(服务)

找到Jenkins,右键菜单,执行stop; 右键菜单 “属性” start type 选择“Disabled”  点击 应用,点击确定。(这一步目的:让jenkins不在以windows 服务的方式在后台运行文章源自玩技e族-https://www.playezu.com/13440.html

Step2.  通过命令行启动Jenkins

java -jar "D:\Program Files (x86)\Jenkins\jenkins.war"文章源自玩技e族-https://www.playezu.com/13440.html

当然,大家也可以做个bat文件,以后每次启动jenkins,双击运行这个bat文件就OK了,bat文件内容如下:文章源自玩技e族-https://www.playezu.com/13440.html

echo "Jenkins CI automation testting"
java -jar "D:\Program Files (x86)\Jenkins\jenkins.war"
pause文章源自玩技e族-https://www.playezu.com/13440.html

Step3.  重新创建Jenkins的Job,重新配置,在执行测试

问题解决了。文章源自玩技e族-https://www.playezu.com/13440.html

注意问题:

(1)通过这种方式启动jenkins,之前以windows service 启动jenkins的数据都丢失了,需要重新创建job。文章源自玩技e族-https://www.playezu.com/13440.html

(2)之前以windows service 启动jenkins中安装的插件也没有了,需要重新安装所需插件。文章源自玩技e族-https://www.playezu.com/13440.html

其他参考:

If you run Jenkins as a service in the background it won't open apps in the foreground. You may either try to run it not as a service in the foreground, or run it as a Local System account and check Allow the service to interact with desktop option. In the latter case you may get into permission problems, though.文章源自玩技e族-https://www.playezu.com/13440.html

玩技站长微信
添加好友自动发送入群邀请
weinxin
rainbow-shownow
玩技官方公众号
官方微信公众号
weinxin
PLAYEZU
 最后更新:2018-10-18
  • 版权提示:本站仅供存储任何法律责任由作者承担▷诈骗举报◁▷新闻不符◁▷我要投稿◁
    风险通知:非原创文章均为网络投稿真实性无法判断,侵权联系2523030730
    免责声明:内容来自用户上传发布或新闻客户端自媒体,切勿!切勿!切勿!添加联系方式以免受骗。
  • 原创转载:https://www.playezu.com/13440.html
    转载说明: 点我前往阅读>>>
匿名

发表评论

匿名网友
确定