0

I need to test an applet on an html page, but I have two restrictions:

  1. I have no any source code and I can't use decompiled codes in my Java application.
  2. I must emulate user behaviour in this applet.

In this case I have to use the htmunit library to get full drawn page with executed javascript for preparing "

  1. htmlunit doesn't have associations with tag EMB
  2. With tag it also doesn't work.

And I have no ideas how I can do my work, except get params of tag EMB, instantiate MyStub object with this params, instantiate Applet object, set my SyStub. This all work in one of my testing case, but in other I need to execute JavaScript located on the page and I have this exception:

java.lang.RuntimeException: Not yet implemented (netscape.javascript.JSObject.getWindow(Applet)).

I understand that my Applet instance doesn't relate with any html page with javascript. How can I set this relation?

Nissa
  • 4,636
  • 8
  • 29
  • 37
glarus089
  • 93
  • 1
  • 7
  • Read [Why CS teachers should stop teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). As is, we can't see any of your HTML or the Applet you have; only the **error**. – Elliott Frisch Jun 02 '16 at 22:13
  • ОК. Applet applet= new Applet(); applet.setStub(new MyStub(someParams)); JSObject window = JSObject.getWindow(applet); – glarus089 Jun 03 '16 at 07:55
  • This post http://stackoverflow.com/questions/19012136/get-a-jsobject-or-jscontext-to-run-an-applet with the same problem. – glarus089 Jun 06 '16 at 07:43

0 Answers0