Jump to content

ellavader

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ellavader's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. So I finally was able to get a working solution for this. I wanted to post it here so others can refer to it if they come across the same issue. Please note that I am doing my testing in a java framework so I am using the autoit jna wrapper that is defined here. The code could be easily transferred to autoit's native lang, but hopefully you will get the idea. This code is assuming IE9 & Win7 environment. Autoitx autoitx = getInstance(); //get a handle to the main window byte[] retWin = new byte[9]; autoitx.AU3_WinGetHandle("[Class:IEFrame]", "", retWin, 9); String winHandle = new String(retWin, 0, 8); String winTitle = "[HANDLE:" + winHandle + "]"; //get a handle to the control (IE9 download info bar) byte[] ctrlWin = new byte[9]; autoitx.AU3_ControlGetHandle(winTitle, "", "[Class:DirectUIHWND]", ctrlWin, 9); String ctrlHandle = new String(ctrlWin, 0, 8); String ctrlTitle = "[HANDLE:" + ctrlHandle + "]"; //must have this line in here in order to get a handle to the control autoitx.AU3_WinWaitActive(ctrlTitle, "[CLASS:DirectUIHWND]", 10); // Get the x, y coordinates of the control x = autoitx.AU3_ControlGetPosWidth(winTitle, "", "[Class:DirectUIHWND]") - 135; //will differ depending on size of control y = autoitx.AU3_ControlGetPosHeight(winTitle, "", "[Class:DirectUIHWND]") - 25; //will differ depending on size of control // Save Prompt autoitx.AU3_ControlFocus(winTitle, "Do you want to open or save", "[CLASS:DirectUIHWND]"); autoitx.AU3_WinActivate(winTitle, "Do you want to open or save"); autoitx.AU3_ControlFocus(winTitle, "Do you want to open or save", "[CLASS:DirectUIHWND]"); autoitx.AU3_ControlClick(winTitle, "", "[Class:DirectUIHWND]", "primary", 1, x, y); //activates the save button autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "{Down}", 0); //down arrow autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "a", 0); //select "save as" // Save as dialog autoitx.AU3_WinActivate("Save As", "Save"); autoitx.AU3_WinWaitActive("Save As", "Save", 10); autoitx.AU3_ControlSetText("Save As", "", "Edit1", filepath); autoitx.AU3_ControlClick("Save As", "", "&Save", "left", 1, 5, 5); autoitx.AU3_ControlClick("Confirm Save As", "", "&Yes", "left", 1, 0, 0); // Close the info bar autoitx.AU3_WinActivate(winTitle, ""); x = autoitx.AU3_ControlGetPosWidth(winTitle, "", "[Class:DirectUIHWND]") - 15; y = autoitx.AU3_ControlGetPosHeight(winTitle, "", "[Class:DirectUIHWND]") - 23; autoitx.AU3_WinActivate(ctrlTitle, ""); autoitx.AU3_ControlClick(winTitle, "", "[Class:DirectUIHWND]", "", 1, x, y); success = autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "{Enter}", 0);
  2. jrwauto, how did you figure out to use "a" for Save As? I'm trying to figure out how to close that info bar, and the only way to do that is by clicking on the "x". I am not having any success with how to do that, and I was hoping that there was a way I could reference it? Not sure that "&Close" works and WinClose() doesn't seem to work, unless I"m passing in the incorrect parameters for it. Do you have any helpful suggestions for me? Thanks in advance.
  3. Looks like there was a posted in July of this year about it. I'm referencing it here in case others come across the same problem. I'm currently investigating this to see if I have any successes:
  4. Any updates on this? I am in the same situation with handling this new notification/information bar in IE9.
×
×
  • Create New...