詹金斯硒不能无休止地进行测试 [英] jenkins selenium do not run test headlessly

查看:89
本文介绍了詹金斯硒不能无休止地进行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jenkins运行pytests硒测试.我在本地计算机上运行了测试.但是,当我运行jenkins时,它无头运行在远程jenkins机器上(在远程jenkins机器上创建工作区),并且由于诸如元素不可见"或由于元素不可点击而导致超时异常"之类的测试错误而失败. 之后,我直接在工作区中的远程计算机(Windows服务器)上进行了测试.它会启动chrome浏览器并运行测试并通过.

I am running pytests selenium tests using jenkins. I ran test on my local machine it works. But when I run through jenkins, it runs on remote jenkins machine(creates workspace on remote jenkins machine) headlessly and it fails with test errors such as 'element not visible' or 'timeout exception due to element not clickable'. After this I ran test on remote machine directly (windows server) in workspace. It launches chrome browser and runs test and passes.

  1. 为什么在通过jenknis运行时会不知不觉地运行测试?
  2. 我可以在运行jenkins时强制打开浏览器吗?
  3. 为什么无头穿过詹金斯,测试会失败?

推荐答案

我假设您的Jenkins在Windows上作为该计算机上的服务运行,此时您可能要尝试两件事:

I assume that your Jenkins is running as service on that machine under Windows, there are 2 things you may want to try at this point:

  1. 在服务中指定本地系统帐户,然后选中允许服务与桌面交互".在此处.但是,这可能会导致其他问题.
  2. WAR文件中运行您的jenkins实例,如果您正在从属计算机上运行测试,请执行以下操作:从命令行启动jenkins slave.
  1. Specify local system account in service and check allow service to interact with desktop. More on how to do it in here. However, it could result in other issues.
  2. Run your jenkins instance from WAR file, case you're running your tests on slave machine: start jenkins slave from command line.

这篇关于詹金斯硒不能无休止地进行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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