Update on iMacros using Java

Information related to the use of iMacros for uptime monitoring, performance and regression testing of websites.

Moderator: iMacros Moderators

Update on iMacros using Java

by Tech Support on Wed Jun 14, 2006 4:49 am

[update] The wrapper below refers to the obsolete COM object "InternetMacros.iim", which now is simply called "imacros". To use the wrapper, you will need to replace this string in the class "IMacrosWrapper.java" (line 133) until a new wrapper is released.

Code: Select all
public class IMacrosWrapper implements RegistryConstants
   /* Instead of providing the CLSID, which might be difficult to
   * obtain and might also change due to changes in the Scripting
   * Interface, the Registry is now queried for the correct CLSID
   * using the ProgID, which is (hopefully) easier to obtain
   //private static final String standardProgID = "InternetMacros.iim"; // <-- old name
   private static final String standardProgID = "imacros";

[End of update]


We updated the IMacrosWrapper class which facilitates the usage of the Scripting Interface and Java classes.
The most important fixes:

0) Names changed to standard names, i.e. with a preceeding iim as in iimPlay(). The old names were kept for downward compatibility. That means that when compiling a class which uses these methods you will get a "Class uses deprecated methods" message by the Java compiler.
However, the class will compile and it will not fail during run time.

1) getLastMessage() and exitAllBrowsers() are not longer supported by the Scripting Interface, thus they were marked deprecated. That means that when compiling a class which uses these methods you will get a "Class uses deprecated methods" message by the Java compiler.
Please note that, although the class will compile, it will fail during run time due to the non-existance of the functions in the iimInterface.dll. This message will be
Code: Select all
org.jawin.COMException: 80020006: Unknown name.

2) The timeout option is now available in calls to iimPlay(), iimDisplay() and iimExit()

3) Return types changed from Short to Integer

4) The CLSID of the iimInterface.dll, which is needed to establish connection between Java and the Scripting Interface, is now dynamically retrieved from the Registry. For this retrieval the ProgID of the dll is needed, which is InternetMacros.iim. This ProgID is used when the standard constructor
Code: Select all
is used. Since the ProgID might change, I also added a new constructor
Code: Select all
IMacrosWrapper(String progId)
which takes the ProgID as argument.

5) The initialization of the jawin bridge to the iimInterface.dll is now included in the iimInit() call (instead of the constructor) and the uninitialization is included in the iimExit() call. That means that the method close() is also deprecated.

Lasse Clausen, iOpus Support
Last edited by Tech Support on Sun Jun 18, 2006 7:37 am, edited 4 times in total.
User avatar
Tech Support
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm


by pigsie on Wed Jun 14, 2006 9:58 am


This is a life saver as it should fix the unknown name error I was geting.
Posts: 6
Joined: Wed May 10, 2006 8:52 am

by jstatham on Sat Jan 20, 2007 4:20 pm

I have followed the instructions at http://www.iopus.com/imacros/tutorials/java.htm
and when I try to compile I get the following error:

cannot access org.jawin.COMException
class file for org.jawin.COMException not found
result = imacros.iimInit();

Can anyone help???
Posts: 10
Joined: Sat Jan 20, 2007 4:13 pm

by mrLenin on Thu Feb 15, 2007 6:22 am

Sorry, but no. I didn't get such error.
Posts: 1
Joined: Tue Jan 16, 2007 2:35 am

Error while running the JavaWrapper Test Program

by vickyd on Mon Nov 05, 2007 9:54 pm


I am trying out this great product to integrate with our application which is in Java.

I have downloaded jawin from http://sourceforge.net/projects/jawinproject/ and wrapper class from http://www.iopus.com/download/imacroswrapper.zip

When I run the test program provided with the example, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jawin/win32/RegistryConstants

Am I using wrong version of Jawin or wrapper class? Please advise and point me to the correct combination of these libraries.

Posts: 1
Joined: Mon Nov 05, 2007 9:37 pm

Return to How-To's and Examples for Web Testing

Who is online

Users browsing this forum: No registered users and 1 guest