Am trying to run a selenium suite using this code which runs perfectly on my local machine but giving an error when deployed on the server saying cannot find the specified file. Any help would be appreciated?
the program and argument:
program = "java";
Arguments = " -jar selenium-server.jar and rest of the argument as in selenium v give browser port and results and testcase file";
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;