Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Exception in thread "main" com.jacob.com.ComFailException: Can't co-create object
- 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:231)
- at net.java.dev.jna.step2_2.Test.main(Test.java:14)'
- import java.io.File;
- import com.jacob.com.LibraryLoader;
- import autoitx4java.AutoItX;
- import junit.framework.Assert;
- public class Test {
- public static void main(String[] args) {
- File file = new File("./src/test/ressources//jacob-1.17-M2-x64.dll"); // path
- System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
- AutoItX x = new AutoItX();
- String notepad = "Untitled - Notepad";
- String testString = "this is a test.";
- x.run("notepad", "C:/Windows/System32", AutoItX.SW_MAXIMIZE);
- x.winActivate(notepad);
- x.winWaitActive(notepad);
- x.send(testString);
- Assert.assertTrue(x.winExists(notepad, testString));
- x.winClose(notepad, testString);
- x.winWaitActive("Notepad");
- x.send("{ALT}n");
- Assert.assertFalse(x.winExists(notepad, testString));
- }
- }
Add Comment
Please, Sign In to add comment