Jump to content

Not able to click the button on File Download with JWinAuto


arpan
 Share

Recommended Posts

Hi folks,

I am new to JWinAuto and AutoIT.

I want to click the save button on the File Download control.

I am able to get the focus on the button but it doesn't click if the current File Download is not in focus. I have set it to top and activated it to have it focused. But still I am not able to click the button.

I am attaching the code here. Can any one please tell if I am missing something..

private static final WString BLANK_STRING = new WString("");
            private static final WString FILE_DOWNLOAD = new WString("File Download");
                System.out.println("hi..");
        JAutoITx wrapper = JAutoITx.INSTANCE;
        wrapper.AU3_Init();
        wrapper.AU3_WinWait(FILE_DOWNLOAD, BLANK_STRING, 15);
        wrapper.AU3_WinActivate(FILE_DOWNLOAD, BLANK_STRING);
        System.out.println(wrapper.AU3_WinActive(FILE_DOWNLOAD, BLANK_STRING));
        wrapper.AU3_WinSetOnTop(FILE_DOWNLOAD, BLANK_STRING, 0);
        wrapper.AU3_ControlFocus(FILE_DOWNLOAD, BLANK_STRING, new WString(
                "[CLASS:Button; INSTANCE:2]"));
                wrapper.AU3_ControlClick(FILE_DOWNLOAD, BLANK_STRING, new WString(
                "[CLASS:Button; INSTANCE:2]"), BLANK_STRING, 1, 6660, 500);
        wrapper.AU3_Send(new WString("s"), 0);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...