Re: how can i run the given google test with java client driver ?

5 views
Skip to first unread message

mayank

unread,
Dec 17, 2007, 1:40:55 AM12/17/07
to selenium-users...@googlegroups.com
well dear i want to ask few question's

1. what is ur objective basically dear
2.have you check in to java file you will have ur open and close answer ?

hope u will have don't give up that early dear try hard........................................

Mayank upadhyay

jignesh c.patel

unread,
Dec 19, 2007, 10:23:07 AM12/19/07
to selenium-users...@googlegroups.com
Hi All,

When am trying to run this from command line got this error

1) Compilation was successful (Did not get any errors and created .class file)
javac -cp .;C:/Junit/junit-4.4.jar;C:/selenium-remote-control-0.9.2/selenium-java-client-driver-0.9.2/selenium-java-client-driver.jar;C:/selenium-remote-control-0.9.2/selenium-server-0.9.2/selenium-server.jar;org.junit.runner.JUnitCore GoogleTest.java

2) when trying to run it shows below error

C:\Tests>java -cp .;C:/Junit/junit-4.4.jar;C:/selenium-remote-control-0.9.2/selenium-java-client-driver-0.9.2/selenium-java-client-driver.jar;C:/selen
ium-remote-control-0.9.2/selenium-server-0.9.2/selenium-server.jar;org.junit.runner.JUnitCore GoogleTest

Exception in thread "main" java.lang.NoClassDefFoundError: GoogleTest (wrong name: com/thoughtworks/selenium/GoogleTest)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


When I added .java at the end then it shows this:

C:\Tests>java -cp .;C:/Junit/junit-4.4.jar;C:/selenium-remote-control-0.9.2/selenium-java-client-driver-0.9.2/selenium-java-client-driver.jar;C:/selen
ium-remote-control-0.9.2/selenium-server-0.9.2/selenium-server.jar;org.junit.runner.JUnitCore GoogleTest.java

Exception in thread "main" java.lang.NoClassDefFoundError: GoogleTest/java

Note: Am running from the directory where GoogleTest exists (i,e : C:/Tests) also tried running from (java/jdk/bin) directory but no success.

What could be the issue?

Please help me on this..

Regards,
Jignesh Patel

jignesh c.patel

unread,
Dec 20, 2007, 12:05:17 AM12/20/07
to selenium-users...@googlegroups.com
yes selenium server is up and running properly
Yes its a sample GoogleTest.java code I am trying to run which is available on site.

For your reference here is the code :

package com.thoughtworks.selenium;

import junit.framework.*;

import org.openqa.selenium.server.*;

public class GoogleTest extends TestCase {
private Selenium selenium;

public void setUp() throws Exception {
String url = "http://www.google.com";
selenium = new DefaultSelenium("localhost", SeleniumServer.getDefaultPort(), "*firefox", url);
selenium.start();
}

protected void tearDown() throws Exception {
selenium.stop();
}

public void testGoogle() throws Throwable {
selenium.open("http://www.google.com/webhp?hl=en");

assertEquals("Google", selenium.getTitle());
selenium.type("q", "Selenium OpenQA");
assertEquals("Selenium OpenQA", selenium.getValue("q"));
selenium.click("btnG");
selenium.waitForPageToLoad("5000");
assertEquals("Selenium OpenQA - Google Search", selenium.getTitle());
}

}

jignesh c.patel

unread,
Dec 24, 2007, 2:26:27 AM12/24/07
to selenium-users...@googlegroups.com
Any idea's, How to resolve this problem?

Please help....

Cheers,
Jignesh Patel

Reply all
Reply to author
Forward
0 new messages