I need to call Selenium from the client side, so I'm trying to run Selenium from a Java applet on a static HTML page.
I am using firefox 3.6.12 in a SUSE Linux environment. The HTML page looks like this:
<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET ALIGN="CENTER" CODE="SeleniumTest.class" WIDTH="800"
HEIGHT="500" archive="/home/******/Selenium/selenium-2.20.0/selenium-
server-standalone-2.20.0.jar,/home/******/Selenium/selenium-2.20.0/
selenium-java-2.20.0.jar,/home/*******/Selenium/selenium-2.20.0/
selenium-firefox-driver-2.0a5.jar" ></APPLET>
</BODY>
</HTML>
The applet was downloaded and informational instructions were printed. But during the creation of the webdriver, I get the following exception in the Java Console and it stops.
Exception in thread "AWT-EventQueue-8" java.lang.NoClassDefFoundError:
Could not initialize class
org.openqa.selenium.firefox.internal.Executable
at
org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:
56)
at
org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:
52)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
84)
at SeleniumTest.getWebDriver(SeleniumTest.java:36)
at SeleniumTest.runTest(SeleniumTest.java:85)
at SeleniumTest.paint(SeleniumTest.java:23)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.X11.XRepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.X11.XComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I added the 'selenium-firefox-driver-2.0a5.jar' to my 'archive' applet declaration attribute in HTML.
Is the applet capable of performing such operations? (Since it uses a JVM, I think it should be)
What else should I do to solve this problem?
Is there any work to run selenium from a browser other than using java applets?
PS: Applet eclipse, . , .