Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 970679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:50:36+00:00 2026-05-16T02:50:36+00:00

Let me be clear: – I have Java.exe in my path environment variable –

  • 0

Let me be clear:
– I have Java.exe in my path environment variable
– So if I want to run a “selenium-server” I will do :

1. Start cmd.exe
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Documents and Settings\cnguyen>
2. Then:
C:\Documents and Settings\cnguyen>cd C:\Selenium RC 0.9.2\selenium-server-0.9.2
3. Next, I'm in the directory that I want so I run:
C:\Documents and Settings\cnguyen>cd C:\Selenium RC 0.9.2\selenium-server-0.9.2

C:\Selenium RC 0.9.2\selenium-server-0.9.2>java -jar selenium-server.jar
09:26:18.586 INFO - Java: Sun Microsystems Inc. 16.3-b01
09:26:18.586 INFO - OS: Windows 2003 5.2 x86
09:26:18.586 INFO - v0.9.2 [2006], with Core v0.8.3 [1879]
09:26:18.633 INFO - Version Jetty/5.1.x
09:26:18.633 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
09:26:18.633 INFO - Started HttpContext[/selenium-server,/selenium-server]
09:26:18.633 INFO - Started HttpContext[/,/]
09:26:18.648 INFO - Started SocketListener on 0.0.0.0:4444
09:26:18.648 INFO - Started org.mortbay.jetty.Server@16a55fa

And here is what I got so far, it compiled but not showing anything 🙁

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace SeleniumProcessExample
{
    public class SeleniumProcess
    {
        private Process pro;
        public SeleniumProcess()
        {

            pro = new Process();
            Directory.SetCurrentDirectory( @"C:\Selenium RC 0.9.2\selenium-server-0.9.2" );

            pro.StartInfo.FileName = "java";
            pro.StartInfo.Arguments = " -jar selenium-server.jar";
            pro.StartInfo.RedirectStandardOutput = true;
            pro.StartInfo.RedirectStandardError = true;
            pro.StartInfo.UseShellExecute = false;

            pro.Start();

            string strOutput = pro.StandardOutput.ReadToEnd();
            string strError = pro.StandardError.ReadToEnd();

            Console.WriteLine( strOutput );
            Console.WriteLine( strError );
            Console.Out.Flush();

            pro.CloseMainWindow(); 
        }
    }
}

EDIT: if you intent is to hide the
selenium-server output window, you’re
going to have to make some
asynchronous calls. I can go into the
details if this is indeed your intent.

I would love to see this. Would you mind showing me how to do this? Thanks a lot for your suggestion 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:50:36+00:00Added an answer on May 16, 2026 at 2:50 am

    This works for me…

        /// <summary>
        /// Creates new process to run and executable file, and return the output
        /// </summary>
        /// <param name="program">The name of the executable to run</param>
        /// <param name="arguments">Any parameters that are required by the executable</param>
        /// <param name="silent">Determines whether or not we output execution details</param>
        /// <param name="workingDirectory">The directory to run the application process from</param>
        /// <param name="standardErr">The standard error from the executable. String.Empty if none returned.</param>
        /// <param name="standardOut">The standard output from the executable. String.Empty if none returned, or silent = true</param>
        /// <returns>The application's exit code.</returns>
        public static int Execute(string program, string arguments, bool silent, string workingDirectory, out string standardOut, out string standardErr)
        {
            standardErr = String.Empty;
            standardOut = String.Empty;
    
            //sometimes it is not advisable to output the arguments e.g. passwords etc
            if (!silent)
            {
                Console.WriteLine(program + " " + arguments);
            }
    
            Process proc = Process.GetCurrentProcess();
    
            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.Arguments = arguments;
            proc.StartInfo.CreateNoWindow = true;
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.RedirectStandardError = true;
            proc.Start();
            proc.WaitForExit();
    
            //only display the console output if not operating silently
            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 proc.ExitCode;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have 10 breakpoints and I want to clear one but not
Let's say I have cleaner like this .cleaner:after { content: '.'; display: block; clear:
Hoping someone can clear this up for me. Let's say I have 2 globals:
Let's say I don't have photoshop, but I want to make pattern files (.pat)
To start off, let me clear the air by saying we are aware of
The title is not clear so let me explain: In my apps, I have
Let me come out very clear. I have some buttons in my Model Window.
EDIT: ok let me be a bit more clear i have a html file
Let me be clear - I have more than enough references and for beginners
Ok Title may not be clear so let me explain. I have 2 classes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.