Jump to content



Photo

How to run AutoItX script as a part o Junit?


  • Please log in to reply
No replies to this topic

#1 MichalD

MichalD

    Seeker

  • Normal Members
  • 1 posts

Posted 18 September 2012 - 08:42 AM

Hello All,

When I run native code:
File file = new File("lib", "jacob-1.17-M2-x86.dll"); //path to the jacob dll System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath()); System.out.println("Done"); AutoItX x = new AutoItX(); System.out.println(System.getProperty("java.library.path")); x.run("notepad.exe");


Everything works OK, but when I try to execute this code as a part of Junit test (after @Test) I get:

java.lang.NoSuchFieldError: m_pDispatch at com.jacob.com.Dispatch.createInstanceNative(Native Method) at com.jacob.com.Dispatch.<init>(Dispatch.java:101) at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58) at autoitx4java.AutoItX.<init>(AutoItX.java:181)









0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users