• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 672
  • Last Modified:

selenium HelloWorld class

hi,

I am following this tutorial
http://www.youtube.com/watch?v=pIYJL9VFYZE

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("http://www.google.com/", "*chrome");

      }
      public void testHelloworldtest() throws Exception {
            selenium.open("/firefox?client=firefox-a&rls=org.mozilla:en-US:official");
            selenium.type("sf", "tommy");
            selenium.click("btnG");
            selenium.waitForPageToLoad("30000");
            selenium.click("link=TOMMY HILFIGER Online Store - USA");
            selenium.waitForPageToLoad("30000");
      }

      public static void main(String args[]) throws Exception {
            org.junit.runner.JUnitCore.main("com.example.tests.HelloWorld");
      }
}

Tommy
Clipboard01.bmp
0
hongclub
Asked:
hongclub
  • 3
  • 3
1 Solution
 
objectsCommented:
what directory is the class file?
you need to include the directory that contains 'com' in your classpath
0
 
hongclubAuthor Commented:
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
0
 
objectsCommented:
> it is in c:\selenium\HelloWorld.class

it needs to be in c:\selenium\com\example\tests\HelloWorld.class
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
hongclubAuthor Commented:
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
Clipboard02.bmp
0
 
hongclubAuthor Commented:
any suggestion?
0
 
objectsCommented:
its failing to startup selenium by the look of it
best to open a new question
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now