ローカルマシン上で完全に動作するこのコードを使用してセレンスイートを実行しようとしていますが、指定ファイルを見つけることができないというサーバーにデプロイしたときにエラーが発生します。どんな助けもありがたいですか?C#経由でセレンを実行するとエラーが発生する
プログラムと引数:
プログラム= "javaの";
引数= "-jarセレニウムのようなselenium-server.jarと残りの引数vブラウザのポートと結果とテストケースのファイルを指定します";
standardErr = String.Empty;
standardOut = String.Empty;
if (!silent)
{
Console.WriteLine("start" + program + " " + arguments);
}
Process proc = Process.GetCurrentProcess();
proc.StartInfo.Arguments = arguments;
if (!string.IsNullOrEmpty(workingDirectory))
{
//execute from the specific working directory if specified
proc.StartInfo.WorkingDirectory = workingDirectory;
}
proc.EnableRaisingEvents = true;
proc.StartInfo.FileName = program;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.Start();
proc.WaitForExit();
if (!silent)
{
if (proc.StandardOutput != null)
{
standardOut = proc.StandardOutput.ReadToEnd();
Console.WriteLine(standardOut);
}
}
if (proc.StandardError != null)
{
standardErr = proc.StandardError.ReadToEnd();
Console.WriteLine(standardErr);
}
proc.StandardOutput.Close();
proc.StandardError.Close();
return standardErr;
ところで、 "csharp"のようなものはありません。言語は "C#"です。 –
ありがとうございましたjohn saundersが私に知らせてくれました... – abhijit