2

We are developing an application which accesses an API exposed over some embedded system. This API internally validates the user to provide the access to the embedded system. To validate the call, it opens a dialog box and asks for username and password. This dialog box is essentially a Java applet opened in applet viewer.

We want to automate this whole process by building small exe or by doing the same in tomcat server. To do the same, we need get the object of the dialog box and fill the credentials. How can we achieve this. There must be some way to automate the testing of applets which can be used to do the above task.

Thanks for helping. It will be great if someone can provide a code snippet or link for the same :)

Reason why I want to have this kind of system:

We need to build an application which gets the memory status of PLC device. This device is connected with heavy machines and has its own programming language via digital networks. To get the memory map, there are APIs exposed in java which communicates with assembly language. We use these APIs to get the memory status of various memory variables from PLC device. On the basis of the memory status we raise an alert by sending an email or SMS. When we try to access the memory area of this device for the very first time, it pops up an authorization dialog box which asks for username and password of PLC device.

Hence, to automate the memory monitoring system which can send the alerts, we have to fill the authorization dialog box through java program or some of the other way. When I access memory of PLC from java console program we need this authorization dialog to be filled by itself without any manual intervention.

So, How can we get an object of this dialog box?

I hope scenario is clear. We don't need any framework to build which can automate the applet UI. We just need for specific dialog box. Please help!!

Gun
  • 61
  • 1
  • 9
  • Read up on 'headless' java, and then, I'm afraid, give up. You need to refactor this to use a proper authentication scheme, like gssapi. – bmargulies May 07 '12 at 23:40
  • We don't have an access to java source code for the APIs. If we decompile though, it does not make a proper code to get it re-compiled again. Hence, using a proper authentication scheme is not possible for us. Any other ideas? There must be some way where remote application can access java applet and run inside its own code. – Gun May 07 '12 at 23:50
  • Why do you write 'must'? It would be a gigantic job to build a GUI simulator. And then to build the framework to allow you to notice which bits of pixel-flipping are your login dialog. – bmargulies May 08 '12 at 10:39
  • Please see the detailed explanation in my question :) – Gun May 09 '12 at 04:11

1 Answers1

1

You can do with with any number of Java GUI functional testing tools. Here's a good list, looks like FEST or Jemmy might be a good approach:

Automated tests for Java Swing GUIs

It looks like they all build on top of java.awt.Robot so you can look at that if you want to roll your own.

If this does not work you may have to go to a native GUI testing framework. Some good options are listed here for Windows:

https://stackoverflow.com/questions/120359/tools-for-automated-gui-testing-on-windows

http://sikuli.org/ pretty good.

Community
  • 1
  • 1
Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197