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

玩技站长
玩技站长
玩技站长
管理员, Keymaster
7080
文章
2
粉丝
经验总结评论1,029字数 362阅读1分12秒阅读模式

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

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

原因:因为jenkins是用windows installer 安装成 windows的服务了,那么jenkins是一个后台服务,所以跑selium cases 的时候不显示浏览器

解决办法

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

找到Jenkins,右键菜单,执行stop; 右键菜单 “属性” start type 选择“Disabled”  点击 应用,点击确定。(这一步目的:让jenkins不在以windows 服务的方式在后台运行

Step2.  通过命令行启动Jenkins

java -jar "D:\Program Files (x86)\Jenkins\jenkins.war"

当然,大家也可以做个bat文件,以后每次启动jenkins,双击运行这个bat文件就OK了,bat文件内容如下:

echo "Jenkins CI automation testting"
java -jar "D:\Program Files (x86)\Jenkins\jenkins.war"
pause

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

问题解决了。

注意问题:

(1)通过这种方式启动jenkins,之前以windows service 启动jenkins的数据都丢失了,需要重新创建job。

(2)之前以windows service 启动jenkins中安装的插件也没有了,需要重新安装所需插件。

其他参考:

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.

 最后更新:2018-10-18
  • 版权提示:非本站文章仅供存储任何法律责任由作者承担▷违法举报◁▷新闻不符◁▷我要投稿◁
    免责声明:部分内容来自用户上传发布或新闻客户端自媒体如有侵权请反馈站长处理
  • 原创转载:阅读转载说明>>> https://www.runacase.com/test/jingyan/jenkinsyunxingselenium-ceshi-buxianshiliulanqi-jiejuefangfa.html
匿名

发表评论

匿名网友
确定

拖动滑块以完成验证