NoClassDefFoundError: watij/iwshruntimelibrary/IWshShell3

32 views
Skip to first unread message
Message has been deleted

chakku

unread,
May 15, 2009, 8:58:28 AM5/15/09
to watij
Hi All,
I am very new to Watij. When I am executing simple watij program(pls
note two lines are commented) the following error message has been
populated. I have checked in Watij.jar file there is not class with
the name 'IWshShell3'. I could not find same in net also. someone can
help me please saying what shold do to fix this issue.

Error msg...

Exception in thread "main" java.lang.NoClassDefFoundError: watij/
iwshruntimelibrary/IWshShell3
at watij.runtime.ie.IE.waitUntilDocumentComplete(IE.java:409)
at watij.runtime.ie.IE.waitUntilDocumentInitializedAndComplete
(IE.java:403)
at watij.runtime.ie.IE.doWaitUntilReady(IE.java:385)
at watij.runtime.ie.IE.waitUntilReady(IE.java:359)
at watij.runtime.ie.IE.html(IE.java:339)
at watij.runtime.ie.IE.document(IE.java:420)
at watij.runtime.ie.IE.element(IE.java:427)
at watij.BaseContainer.htmlElements(BaseContainer.java:22)
at watij.BaseHtmlFinder.htmlElements(BaseHtmlFinder.java:551)
at watij.BaseHtmlFinder.textFields(BaseHtmlFinder.java:56)
at watij.BaseHtmlFinder.textField(BaseHtmlFinder.java:52)
at GoogleTest.testGoogleSearch(GoogleTest.java:11)
at GoogleTest.main(GoogleTest.java:19)


My program...

import junit.framework.TestCase;
import watij.runtime.ie.*;
//import watij.iwshruntimelibrary.IWshShell3;
//import watij.iwshruntimelibrary.WshShell;
import static watij.finders.SymbolFactory.*;

public class GoogleTest extends TestCase {
public void testGoogleSearch() throws Exception {
IE ie = new IE();
ie.start("http://www.google.com");
ie.textField(name,"q").set("Watij");
ie.button("Google Search").click();
assertTrue(ie.containsText("/Web Application Testing in
Java/"));
}
public static void main(String str[]) {
GoogleTest obj = new GoogleTest();
try
{
obj.testGoogleSearch();
}
catch (Exception e)
{
System.out.println(e);
}

}
}

Darrell Grainger

unread,
May 15, 2009, 9:29:38 AM5/15/09
to wa...@googlegroups.com
I've never tried to mix a JUnit TestCase and a Java application. By
declaring the class as extending TestCase you have created a JUnit
test case. By adding a main(), instantiating an instance of the class
and calling the test method as if it was a regular Java application is
not how you run a JUnit test case.

Have a look at http://junit.sourceforge.net/doc/faq/faq.htm for
information on JUnit and how to run a simple JUnit test case. If that
does not fix the problem then you have something in your environment
which is affecting the running of Java applications. Most commonly,
the JRE installed for a web browser is conflicting with a JDK
installed for development.

2009/5/15 chakku <chakkara...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages