selenium HelloWorld class

Posted on 2011-05-08
Last Modified: 2013-11-24

I am following this tutorial

i tried to compile, and run the HelloWorld example.
i can compile to a class, However, i got the error (see screenshot) when i try to run
java HelloWorld
or java com.example.tests.HelloWorld

Please advise, i am not that expert in java, little help will be great!

Here is my HelloWorld souce:
package com.example.tests;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class HelloWorld extends SeleneseTestCase
      public void setUp() throws Exception
            setUp("", "*chrome");

      public void testHelloworldtest() throws Exception {
            selenium.type("sf", "tommy");
  "link=TOMMY HILFIGER Online Store - USA");

      public static void main(String args[]) throws Exception {

Question by:hongclub
    LVL 92

    Expert Comment

    what directory is the class file?
    you need to include the directory that contains 'com' in your classpath

    Author Comment

    u mean the HelloWorld class file? it is in c:\selenium\HelloWorld.class

    include the directory that contains "com", can you give me more detail?

    Sorry, i haven't touched java for a long time, get confused!!!
    i just want to make the final run the HelloWorld.class, so i can run my first test case of selenium
    LVL 92

    Expert Comment

    > it is in c:\selenium\HelloWorld.class

    it needs to be in c:\selenium\com\example\tests\HelloWorld.class

    Author Comment

    thanks, i got it running after i put the class there.

    but i got this error message for my selenium testing case failed, do u know why?

    please see screenshot

    Author Comment

    any suggestion?
    LVL 92

    Accepted Solution

    its failing to startup selenium by the look of it
    best to open a new question

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    NotAlone Challenge 20 65
    method argument as final 1 54
    scores100 challenge 3 67
    Logs to delete in Windows VCenter server ? 11 89
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now