Guest User

Untitled

a guest
Feb 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. 'Exception in thread "main" com.jacob.com.ComFailException: Can't co-create object
  2. at com.jacob.com.Dispatch.createInstanceNative(Native Method)
  3. at com.jacob.com.Dispatch.<init>(Dispatch.java:101)
  4. at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
  5. at autoitx4java.AutoItX.<init>(AutoItX.java:231)
  6. at net.java.dev.jna.step2_2.Test.main(Test.java:14)'
  7.  
  8. import java.io.File;
  9. import com.jacob.com.LibraryLoader;
  10. import autoitx4java.AutoItX;
  11. import junit.framework.Assert;
  12. public class Test {
  13. public static void main(String[] args) {
  14. File file = new File("./src/test/ressources//jacob-1.17-M2-x64.dll"); // path
  15. System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
  16. AutoItX x = new AutoItX();
  17. String notepad = "Untitled - Notepad";
  18. String testString = "this is a test.";
  19. x.run("notepad", "C:/Windows/System32", AutoItX.SW_MAXIMIZE);
  20. x.winActivate(notepad);
  21. x.winWaitActive(notepad);
  22. x.send(testString);
  23. Assert.assertTrue(x.winExists(notepad, testString));
  24. x.winClose(notepad, testString);
  25. x.winWaitActive("Notepad");
  26. x.send("{ALT}n");
  27. Assert.assertFalse(x.winExists(notepad, testString));
  28. }
  29. }
Add Comment
Please, Sign In to add comment