scsnake Posted March 29, 2009 Share Posted March 29, 2009 there's ie form and a "submit" button, when "submit" is clicked there pops up a dialog box (by javascript onclick) for confirmation, and the dialog box has two buttons (accept, cancel)i use UDF in IE.au3 to select all checkboxes, click the "submit", but fail to click the accept button in dialog boxi have tried ControlClick("[Class:#32770]","...text...","[ClassNN:Button1]","left")or just useWinWait and WinActivate ("[Class:#32770]","...text...") and then send("{enter}")but both fail to work >"< any suggestions the following are informations of that dialog box (the accept button):>>>> Window <<<<Title: Windows Internet ExplorerClass: #32770Position: 410, 326Size: 468, 166Style: 0x94C801C5ExStyle: 0x00010101Handle: 0x000B0674>>>> Control <<<<Class: ButtonInstance: 1ClassnameNN: Button1Advanced (Class): [CLASS:Button; INSTANCE:1]ID: 1Text: 確定(traditional chinese character that means "accept")Position: 270, 100Size: 88, 28ControlClick Coords: 43, 18Style: 0x50030001ExStyle: 0x00000004Handle: 0x00050702>>>> Mouse <<<<Position: 726, 467Cursor ID: 2Color: 0xB5E2FA>>>> StatusBar <<<<>>>> Visible Text <<<<確定(traditional chinese character that means "accept")取消(traditional chinese character that means "cancel")Are you sure you want to delete all selected personal messages?>>>> Hidden Text <<<<----for anyone playing dead frontier, i want to check all messages in that page, and click "deleted selected" submit button, and click the accept button in dialog box Link to comment Share on other sites More sharing options...
Authenticity Posted March 29, 2009 Share Posted March 29, 2009 It's likely that there may be only one window with that dimensions on your system at once, you can try this: Opt('WinTitleMatchMode', 4) ... .. . WinWaitActive('[W:468; H:166]') ControlClick('[W:468; H:166]', '', 'Button1') You can at least try it. ;] Link to comment Share on other sites More sharing options...
Valuater Posted March 29, 2009 Share Posted March 29, 2009 I have seen where someone used Send "Tab" and then Send "Enter" and that worked for them Just an Idea... 8) Link to comment Share on other sites More sharing options...
scsnake Posted March 29, 2009 Author Share Posted March 29, 2009 (edited) both of your method are tested, but still not work >"<by the way, my OS is vista(home basic), ie 7---------this is my script:$oIE=_IEAttach($handle,"HWnd")$oForm=_IEFormGetObjByName($oIE,"pmFolder")_IEFormElementCheckBoxSelect($oForm,"0","","1","byIndex")$oSubmit=_IEFormElementGetObjByName($oForm,"del_selected")_IEAction($oSubmit,"click") ->after the click pops the dialog, and full script pauseMsgBox(1,"","test") msgbox will only appear after dialog box disappearso that's the problem, the script pauses at _IEActionany idea that can solve this problem??-----------------------------ok this is the solution:i use _IEAction($oSubmit,"focus") and send("{enter}") instead of _IEAction($oSubmit,"click")and everything goes fine !! Edited March 29, 2009 by scsnake Link to comment Share on other sites More sharing options...
dnnytn Posted December 30, 2015 Share Posted December 30, 2015 Hi scsnake, everyone, I am facing the same issue but is not able to replicate your success with your fix. Last post is several years back so I am just trying my luck. Its a password reset portal that my company's HQ requires all new users to use to reset their newly created accounts. However, locally, we have already had other systems and complex password has already been created for them. This is me trying to automate the process for them so that they do not have to manage so many different passwords. This is the source of the button i am trying to automate the click on. ############################<INPUT name=ctl00$ContentPlaceHolder$btn_Send id=ContentPlaceHolder_btn_Send onclick="return confirm('INF0250:パスワードを変更します。よろしいですか?\nINF0250:Your password will be changed. Do you want to continue?');" type=submit value=Send>############################My script is working up till clicking on the Send button, where it gives me a Dialog box where I have to click "OK". The script just stops there, although the dialog box has focus and all i need to do is press "Enter"; all script actions i attempted does not seem to work. ####################################;populate fields in the form _IEFormElementSetValue($GIMSFormUser, $FwdAddr) _IEFormElementSetValue($GIMSFormOldPassword, $StandardPassword) _IEFormElementSetValue($GIMSFormNewPassword, $Password) _IEFormElementSetValue($GIMSFormNewPasswordCon, $Password) ;click Send _IEAction($GIMSFormSend, "click") ;Sleep(2000) WinWaitActive("[CLASS:#32770]") Sleep(500) Send("{ENTER}")####################################This is from AutoInfo.exe>>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 Name: Advanced (Class): [CLASS:Button; INSTANCE:1] ID: 1 Text: OK Position: 261, 96 Size: 88, 26 ControlClick Coords: 43, 12 Style: 0x50030000 ExStyle: 0x00000004 Handle: 0x00220E1C >>>> Mouse <<<< Position: 769, 446 Cursor ID: 0 Color: 0x7D3200 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK Cancel INF0250:パスワードを変更します。よろしいですか? INF0250:Your password will be changed. Do you want to continue? >>>> Hidden Text <<<<########################I have attempted _IEAttach, ControlSend. Except for MouseClick(), which I do not want to use as it will not work with users with different screen resolutions. Any help is appreciated! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 30, 2015 Moderators Share Posted December 30, 2015 dnnytn,all script actions i attempted does not seem to workWhich is quite normal when you consider what you are trying to do. Anyway, we are not prepared to support automatic password changing - for what I hope are obvious reasons. Thread locked.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts