jenkins selenium do not run test headlessly

╄→гoц情女王★ 提交于 2021-02-10 06:45:47

问题


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. Why is it running test headlessly when run through jenknis?
  2. Can I make it to force open browser while running through jenkins?
  3. Why tests are failing when ran through jenkins headlessly?

回答1:


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. 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.


来源:https://stackoverflow.com/questions/44374797/jenkins-selenium-do-not-run-test-headlessly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!