Solved: Creating A Batch file to run Selenium RC

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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>
 
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.
 
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.
 

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.
 
Joined
Jan 16, 2011
Messages
119
From what I can see: The path is starting at c:\windows\system32>
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?
 

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
 

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).
 
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
 

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.
 
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
 

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
 

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
118,608
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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top