1

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;
2
  • BTW, there's no such thing as "csharp". The language is "C#". Commented Jul 20, 2011 at 16:24
  • thanks john saunders for letting me know... Commented Jul 21, 2011 at 6:25

1 Answer 1

1

Make sure the local machine and the server have the same environment settings (Path, classpath etc.)

Next (if the problem remains) try to find out what file can't be found (Eventlog, other logs)

Sign up to request clarification or add additional context in comments.

1 Comment

i tried checking the event-log there was a dns errors...even i think your ans is the solution to my problem thanks up-voted, i would mark it as an answer once its up running on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.