Re: Selenium : package com.thoughtworks.selenium does not exist

711 views
Skip to first unread message

Gavin Brewer

unread,
Dec 19, 2008, 8:25:25 AM12/19/08
to selenium-users...@googlegroups.com
I have the same problem!

Despite pointing the CLASSPATH environment variable to the Java Client JAR,  I still get a message telling me that the package *com.thoughtworks.selenium* does not exist! There must be something wrong with the way I have defined my CLASSPATH, but I cant see what it could possibly be. :-|

Could somene please help us? 8-)

Cheers,
          Gavin.

Gavin Brewer

unread,
Dec 22, 2008, 9:02:43 AM12/22/08
to selenium-users...@googlegroups.com
I simply use the following:
{font:style=color: #0000ff;} \\{font}
{font:style=font-family: courier new,courier; color: #0000ff;}C:\Documents and Settings\gavin\Desktop\scripts>*javac NewTest.java* \\ NewTest.java:3: package com.thoughtworks.selenium does not exist \\ import com.thoughtworks.selenium.*;{font}
{font:style=font-family: courier new,courier; color: #0000ff;}^ \\ NewTest.java:6: cannot find symbol \\ symbol: class SeleneseTestCase \\ public class NewTest extends SeleneseTestCase {{font}

etc. etc.

My CLASSPATH contains:

{font:style=font-family: courier new,courier;}C:\seleniumRC\src\selenium-java-client-driver-1.0-beta-1\selenium-java-client-driver.jar{font}

Cheers,
               Gavin.

Xuan Ngo

unread,
Dec 22, 2008, 10:24:43 AM12/22/08
to selenium-users...@googlegroups.com
Hi Gavin,

You probably set your Classpath wrong or didn't restart your Command Prompt for the change to take effect.


{font:style=font-size: 12pt;}*1-Make sure that the path is correct:*{font}
{font:style=font-family: courier new,courier; color: #0000ff;}*dir C:\seleniumRC\src\selenium-java-client-driver-1.0-beta-1\selenium-java-client-driver.jar*{font}
If it returns "The system cannot find the path specified.", then your path is incorrect.

*{font:style=font-size: 12pt;}2-{font}*{font:style=font-size: 12pt;}*To rule out your setting with Classpath, just specify the Classpath directly to javac.*{font}
Therefore, instead of
{font:style=font-family: courier new,courier; color: #0000ff;}*javac NewTest.java*{font}

use this

{font:style=font-family: courier new,courier; color: #0000ff;}*javac -classpath {font:style=color: #ff0000;}C:\seleniumRC\src\selenium-java-client-driver-1.0-beta-1\selenium-java-client-driver.jar{font} NewTest.java*{font}


Note: Depending on 1-, change the red part to the location of your {font:style=font-family: courier new,courier; color: #0000ff;}*{font:style=color: #ff0000;}selenium-java-client-driver.jar{font}*{font} file.

Xuan.
[openwritings.net|http://openwritings.net]

Gavin Brewer

unread,
Dec 22, 2008, 10:46:58 AM12/22/08
to selenium-users...@googlegroups.com
Thanks Xuan!

I used the full *javac -classpath* *<blah>* thing and I managed to compile the supplied test script Google.java successfully!

Now there is the small matter of getting IDE-exported Java tests to work...&nbsp; 8-(|:-))

Specifically, I want to set CLASSPATH to point to *{font:style=color: #3366ff;}C:\junit4.5\junit-4.5.jar{font}* amongst other targets.

Setting multiple classpaths on the javac command line can get messy, so how do I make the:
*Control Panel->System->Advanced->Environment Variables* thing work?

Here is a complete listing of CLASSPATH as&nbsp; defined under: *'User variables for gavin'*

C:\Program Files\Satamatics\TSLc\tslc.jar;
C:\seleniumRC\src\selenium-java-client-driver-1.0-beta-1\selenium-java-client-driver.jar;
C:\junit4.5\junit-4.5.jar; C:\selenium_test;

Merry Christmas,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gavin.

Paul Hammant

unread,
Dec 22, 2008, 1:22:45 PM12/22/08
to selenium-users...@googlegroups.com
yes it does.

try this -

svn co https://svn.openqa.org/svn/selenium-rc/trunk/sample selenium-
sample
cd selenium-sample
build.bat
test.bat

then report your findings.

Regards,

- Paul

Reply all
Reply to author
Forward
0 new messages