当詹金斯(Jenkins)和nUnit运行硒测试时,浏览器没有启动,但是有有效的结果 [英] When selenium test runs by Jenkins and nUnit, the browser doesn't come up however there are valid results

查看:145
本文介绍了当詹金斯(Jenkins)和nUnit运行硒测试时,浏览器没有启动,但是有有效的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要说的是我的问题是缺乏信息,我需要一些确认而不是真正的问题.似乎其他人也有类似的问题

I would say that my problem rather lack of information and I need some confirmation than a real problem. It seems somebody else had similar question question.

出于POC原因,我将一台机器(Windows Server 2012R2)放在一起,安装了Jenkins,并使用

I put together a machine (Windows Server 2012R2) for POC reasons where a Jenkins installed and it executes Selenium UI tests using nunit. The nunit tests are generated by Specflow.

我可以做到:

  • 安装詹金斯
  • jenkins由有效用户而非服务帐户运行
  • 正确设置詹金斯
  • 它可以从TFS-GIT中提取源代码
  • 它可以编译C#解决方案
  • 它可以执行测试项目
  • 测试结果正确

Selenium插件安装在Jenkins上,但我认为这种情况下不使用它,因为文本执行是关于执行nunit的,它可以处理其他所有内容.

Selenium plugin installed on Jenkins but I don't think it is used in this case because the text execution is about executing nunit and it deals with everything else.

目前,我不需要将测试执行委托给其他Jenkins从属或机器的功能,因为Jenkins确实只有一个编译任务.编译,执行和测试运行可以并行进行,机器可以对其进行处理.

At the moment I don't need the capability to delegate test execution to other Jenkins slaves or machines because the Jenkins does have only one compile task. Compiling, executing and test running can go parallel, the machine able to deal with it.

但是,当我登录运行Jenkins的服务器并看到CI生成(编译和测试执行)期间发生的情况时,我看不到浏览器(Firefox)启动,但是测试结果和日志显示浏览器已执行.

But, when I log in the server where the Jenkins runs and I watch what happens during CI build (compile and test execution) I can't see that the browser (Firefox) starts, however, the test results and the logs show that a browser was executed.

我到目前为止所做的:

  • jenkins作为服务运行,该帐户是现有帐户

如果我使用为该服务设置的帐户远程访问计算机,则看不到将执行浏览器,但是,日志显示发生了某些事情.

If I remote to the machine with the account which is set up for the service, then I can't see the browser will be executed, however, the log shows that something had happened.

我的问题是,当詹金斯执行我的测试时,会发生什么黑客攻击?如果我从同一台计算机的控制台上执行Jenkins所使用的命令,那么我可以看到Firefox启动了,执行了测试中编程的内容,结果在result.xml中.我可以接受结果作为有效结果吗?

My question is that, what the hack is happening when my tests are executed by Jenkins? If I execute the command which is used by Jenkins from console on the same machine then I can see that Firefox starts, does what is programmed in the tests and the results are in the result.xml. Can I accept the result as valid result? Can I somehow set up Jenkins the way the browser really executed (I can believe it when I see it :) )?

推荐答案

我认为这是因为您将Jenkins作为服务运行.服务不会显示在桌面上.解决方法是从CMD运行Jenkins或奴隶.

I think this is because you run Jenkins as a service. Services do not show up in desktop. Workaround is to run Jenkins or slave from CMD.

Jenkins Windows从服务不与桌面交互

这篇关于当詹金斯(Jenkins)和nUnit运行硒测试时,浏览器没有启动,但是有有效的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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