1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Creating A Batch file to run Selenium RC

Discussion in 'DOS/Other' started by patricklee, Jan 18, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    I am running Windows 7 home premium

    I have tried to create a batch file that should run Selenium RC but the path is coming up incorrect.
    The batch file is coded like this :And saved as a bat.

    @echo off
    START "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java -jar selenium-server.jar"

    The cmd opens up but I get this in the cmd windows

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>
     
  2. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Try this:
    Code:
    START [COLOR=Red][B]""[/B][/COLOR] "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java[COLOR=Red][B]"[/B][/COLOR] -jar selenium-server.jar
    Windows often doesn't like having parameters inside the quotes, and Start sometimes sees the first thing in quotes as a title instead of the program, so the first two quotes take care of that.
     
  3. gyclone

    gyclone

    Joined:
    Jan 16, 2011
    Messages:
    119
    The "@echo off" is suppressing any error messages that might give you more information about what is going on. I'd remove that, first, then see what messages you get in cmd.

    Also, try typing your "START ..." command directly into a cmd, see if you get a different result there.

    I don't know anything about Selenium, but I do know a little about batch files, so I might be able to help further.
     
  4. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    Windows 7 Home Premium is my operating system 64 bit

    1. I have created a new batch file with this line of code:

    @echo on
    START "" "c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java" -jar selenium-server.jar

    2. Dialog Box Error Message pops us that states:

    Windows cannot find 'c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java'. Make sure you typed the name correctly, and then try again

    3. The cmd command line is also launches at the same time and freezes: Its starts with this path:

    C:\Windows\system32>START "" "c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java" -jar selenium.jar

    From what I can see: The path is starting at c:\windows\system32> and not the path I have specified in the batch file. Can you help me.
     
  5. gyclone

    gyclone

    Joined:
    Jan 16, 2011
    Messages:
    119
    You can ignore the "c:\windows\system32>", cmd is not treating that as part of the file path.

    Have you tried just typing your entire command into the command line, instead of running it from the batch file; if so does it work from there?
     
  6. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    Yes I tried to type the same command from the batch file and i get the same results as running the batch file
     
  7. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    I have check the spelling and I just pasted it into the cmd command line.
     
  8. gyclone

    gyclone

    Joined:
    Jan 16, 2011
    Messages:
    119
    Try just typing:

    Code:
    START "" java -jar selenium-server.jar
    
     
  9. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    The command (START "" java -jar selenium-server.jar) does launch the Selenium RC server when I am in the current (Path = c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3>). If I am not in this path the command does nothing. I even tried typing the command at the Root of C:\ and nothing happens. So it works when I am in the directory (Selenium-server-1.03).
     
  10. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Let's try using the /D switch to specify the starting directory:
    Code:
    START "" /D "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3" java -jar selenium-server.jar
     
  11. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    That's it !!! Thank You very much. I have enjoyed learning from you. I will research the /D command also.
     
  12. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    You're Welcome!

    Sorry for the typo, that should have been /D, not /.D (fixed now). Darn keys are too close together sometimes. At least it wasn't in the actual command line:eek:

    Jerry
     
  13. patricklee

    patricklee Thread Starter

    Joined:
    Jan 18, 2011
    Messages:
    11
    Thanks Jerry

    The code you sent was correct the first time. I really appreciate your help. The batch file is working correctly now. Thanks Again
     
  14. Cookiegal

    Cookiegal Administrator Malware Specialist Coordinator

    Joined:
    Aug 27, 2003
    Messages:
    113,999
    patricklee,

    You are reporting TheOutcaste's post rather than replying to it here.

    The report button is only to report abuse or offensive posts.

    Please use the reply button to reply here in the thread.
     
  15. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/975344

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice