使用tomcat设置的jenkins运行硒测试时,浏览器不可见 [英] Browser not visible when running selenium test with jenkins set up with tomcat

查看:132
本文介绍了使用tomcat设置的jenkins运行硒测试时,浏览器不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在用Tomcat运行jenkins.当我们尝试使用jenkins作业运行selenium Web驱动程序时,没有任何反应.我们无法在jenkins机器上看到浏览器正在打开,但没有收到任何错误.在同一台机器上运行带有eclipse的相同代码时,浏览器可以正常打开.

We are running jenkins with Tomcat. When we try to run the selenium web driver with a jenkins job, Nothing happens. We are unable to see the browser opening on the jenkins machine but we don't get any errors. On running the same code with eclipse on the same machine, the browser opens up fine.

推荐答案

大多数Windows服务(包括在Windows XP和Vista中使用允许服务与桌面进行交互"选项运行的服务)无法访问许多计算机的资源,包括控制台显示.如果您将Apache Tomcat作为Windows服务运行并且正在执行任何GUI测试,则这可能会导致自动GUI测试失败.

Most Windows services -- including those run with the option "Allow service to interact with desktop" in Windows XP and Vista -- do not have access to many of the computer's resources, including the console display. This may cause Automated GUI Tests to fail if you are running Apache Tomcat as a Windows Service and are doing any GUI testing.

可以通过不将Tomcat作为Windows服务运行,而是通过计划任务"作为在登录时运行的应用程序来解决此限制.有几个选项可以执行此操作,例如运行"$ TOMCAT_HOME \ bin \ tomcat5.exe".在Windows Vista中设置计划任务时,请考虑从常规"选项卡中选择以最高特权运行"复选框,因为这消除了始终提供管理员特权的需要,并且还可以解决其他问题.

This limitation can be resolved by not running Tomcat as a Windows Service, but instead through a "Scheduled Task" as an Application that runs at logon. There are several options for doing this, an example would be to run "$TOMCAT_HOME\bin\tomcat5.exe". When setting up the scheduled task in Windows Vista consider choosing the check-box for "Run with highest privileges" from the general tab, as this removes the need to always provide administrator privileges and may resolve other issues as well.

这篇关于使用tomcat设置的jenkins运行硒测试时,浏览器不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆