我正在设置 CCNET 服务器来运行 Selenium 测试。在我的测试代码中,如果 Selenium RC 服务器未运行,我将使用以下命令来启动它:
var proc = new Process();
proc.StartInfo.WorkingDirectory = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, @"..\..\..\..\..\lib\SeleniumRC\selenium-server-1.0-beta-2");
proc.StartInfo.FileName = "java"; //have also tried with "java.exe"
proc.StartInfo.Arguments = @"-jar selenium-server.jar -multiWindow -trustAllSSLCertificates -firefoxProfileTemplate ""..\Firefox Profiles\Relaxed Security""";
proc.StartInfo.UseShellExecute = true;
proc.Start();
这在我的开发机器上效果很好。但是,当我从 CCNET.exe(在用户上下文下)运行它时,我可以看到不是执行 java.exe 进程,而是弹出一个“c:\windows\java”的资源管理器窗口。我认为我的路径设置弄乱了,但我不知道怎么办。你能帮忙吗?
最佳答案
您是否尝试过在运行它的用户上下文下的命令提示符下进入该工作目录并尝试命令行?
如果路径设置困惑,可以通过右键我的电脑、属性、高级、环境变量...进行调整
关于c# - 从 C# 调用的 Selenium Java 进程在 CCNET 构建服务器上无法正常启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/666813/