gec100 Posted November 14, 2014 Share Posted November 14, 2014 Hi all i have this app that is used for updating our companies financial software and i'm trying to automate it. My problem is that none of Send, ControlClick, ControlSend, ControlSendText are working on this app. There is one other app that is used for backup and i automated that with no problems. The problematic app opens normally with ShellExecute and has a Start button to start update process that can be clicked or run using Alt+S. I've tried everything i can think of but just can't click that button. Here is the code i've tried: #include <Debug.au3> #include <MsgBoxConstants.au3> _DebugSetup("Debugw", True) ;_DebugSetup("Debugw", False, 4, "wFlash.txt", True) WinMove("Debugw", "", 7, 6, 427, 319) _DebugOut("Opening Fresh") ShellExecute ("Fresh.exe","", "...") If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "Fresh error "& $iFlash) Exit EndIf $hWndFresh = WinWait("Fresh", "", 10) If $hWndFresh == 0 Then MsgBox($MB_SYSTEMMODAL, "Error", "Fresh not started.") _DebugOut("Fresh not started") Exit EndIf _DebugOut("Fresh started") Sleep(2000) $hCtrlStart = ControlGetHandle ($hWndFresh, "", 16408) _DebugOut("Start handle: " & $hCtrlStart) ;$ctrlClc = ControlClick ($hWndFresh, "", 16408) ; no error but nothing happening ;$ctrlClc = ControlSend ($hWndFresh, "", 16408, "!{s}") ; no error but nothing happening ;$ctrlClc = ControlSetText ($hWndFresh, "", 16408, "!{s}") ; error - window/control is not found. !? not sure what's happening here ;$ctrlClc = ControlClick ($hWndFresh, "", $hCtrlStart) ; no error but nothing happening $ctrlClc = ControlSend ($hWndFresh, "", $hCtrlStart, "!{s}") ; no error but nothing happening If $ctrlClc == 0 Then MsgBox($MB_SYSTEMMODAL, "Error", $ctrlClc & " - window/control is not found.") _DebugOut("window/control is not found") Exit EndIf _DebugOut("Started") Here is some window info: Title: Fresh V.14.10.07 Class: ClaWin0400000H_1 Some control info: Class: ClaButton_0400000H Instance: 1 ClassnemeNN: ClaButton_0400000H1 Name: Advanced Mode: [CLASS:ClaButton_0400000H; INSTANCE:1] ID: 16408 Text: &Start AutoIt is version 3.3.12.0 under Win 8.1 Any ideas? Thx Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 14, 2014 Share Posted November 14, 2014 (edited) You have problem with the run button or with everything else? I would try to use Run, with FileSelectFolder (if multipel ppl will use the program, they can select the folder where their copy of the program is, and the script starts to autorun it), Also you can try to use AU3Recotrder to simply record yourself clicking the button (don't know why should it work while the others dont, but it could worth a try in my opinion) Edited for AU3Recorder Edited November 14, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
gec100 Posted November 14, 2014 Author Share Posted November 14, 2014 Thx SorryButImaNewbie. There are 4 buttons, Start, Settings, Help and Exit. None of which i am able to use. Tried Run() but it does not run the app. That's why i'm using ShellExecute. Link to comment Share on other sites More sharing options...
JohnOne Posted November 14, 2014 Share Posted November 14, 2014 Try.. $hCtrlStart = ControlGetHandle ($hWndFresh, "", "[CLASS:ClaButton_0400000H; INSTANCE:1]") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted November 14, 2014 Share Posted November 14, 2014 If it fails, it might be that the controls are not standard, and fall outside the boundries of what AutoIt can manipulate natively. If that is the case, your next port of call should be '?do=embed' frameborder='0' data-embedContent>> AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
gec100 Posted November 14, 2014 Author Share Posted November 14, 2014 thx JohnOne i am getting the handle and when tested it is the same as ID handle (in the test it was 0x00000000003D07E8) Link to comment Share on other sites More sharing options...
JohnOne Posted November 14, 2014 Share Posted November 14, 2014 Try your click like that. $ctrlClc = ControlClick ($hWndFresh, "", "[CLASS:ClaButton_0400000H; INSTANCE:1]") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
gec100 Posted November 14, 2014 Author Share Posted November 14, 2014 Nothing Link to comment Share on other sites More sharing options...
gec100 Posted November 14, 2014 Author Share Posted November 14, 2014 My smili did not go through. :-( As in most cases, app opens but click is still not working. I also tried to change focus with ControlFocus to a different button but dat also did not work. Could it be some permission problem or the language the app was written in? Link to comment Share on other sites More sharing options...
JohnOne Posted November 15, 2014 Share Posted November 15, 2014 No, It's not permission. It's follow the link I gave you earlier to that UI stuff. That is your last choice. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheSaint Posted November 15, 2014 Share Posted November 15, 2014 If you are using WinActivate along with Send or the others, you should get a result. I always play it safe, by also using WinActive, usually with a timeout etc. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
junkew Posted November 15, 2014 Share Posted November 15, 2014 Try with simplespy as given in faq 31 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now