aPete Posted September 20, 2017 Share Posted September 20, 2017 I'm trying to update a script that was written ~5 years ago by someone else to automate a software installation in order to make it work with Win10. The problem I'm having is that the software in question pops up a window of class #32770 in order to allow the user to input registration information, and nothing I've tried so far has worked. I'm able to user ControlGetText to read from it, but ControlFocus returns 0 (failure) whenever I try to use it, and ControlSend and ControlSetText both result in nothing happening. Pointing ControlClick at the various controls in the window always results in Edit1 appearing to have focus, no matter which control it's actually targeted at. Plain old Send doesn't do anything, even when one of the Edit controls appears to have focus. Googling pulled a few discussions around #32770 windows, but none of them were direct matches for my situation, and none of the solutions proposed in those discussions worked for me. The actual script is more complex, but the bare bones of the problem are that the following snippet doesn't work: WinActivate($windowHandle) ControlFocus($windowHandle, "", "Edit1") ControlSend($windowHandle, "", "Edit1", $textThatNeedsToBeEnteredInEdit1) substituting ControlSetText for the ControlSend doesn't help, nor does using Send, and as mentioned above, ControlFocus returns 0, so it's failing. Oddly, if put a ControlGetText line in the script, manually type something into one of the fields, and then run the section of the script I'm trying to debug, I'm able to capture text from the field, so obviously I've got the right window handle and the right control names/IDs. Anybody have any idea on why the methods to actually interact with the window's controls won't work but the method to read from them will? The only things that stick out to me as potentially weird about the situation are that I'm writing and compiling the script on a Win7 machine and running it on a Win10 machine, and that the window in question is (I think) a child of one of the previous windows in the script. Could those things be a part of the problem, and if so, is there a reasonable workaround? Thanks for any help anyone can provide. Link to comment Share on other sites More sharing options...
aPete Posted September 20, 2017 Author Share Posted September 20, 2017 One other piece of info, as well. WinKill($windowHandle) returns 1 (success), but the window doesn't die. Dunno if that helps with diagnosis, but I guess it's one more piece of the puzzle. Link to comment Share on other sites More sharing options...
junkew Posted September 23, 2017 Share Posted September 23, 2017 Check element with simplespy. Check 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...
aPete Posted September 25, 2017 Author Share Posted September 25, 2017 The window in question seems to be immune to simplespy. All I get when I try to type ctrl-w on the window I'm trying to manipulate is simplespy crashing with the generic error "simplespy.exe has stopped working." Link to comment Share on other sites More sharing options...
junkew Posted September 25, 2017 Share Posted September 25, 2017 (edited) Weird but maybe start 2 instances of simplespy at same time then one instance of simplespy will not get paused when you hover the simple spy tray icon.. I can spy all icons in systray and submenus and highlight them. See also this one Edited September 25, 2017 by junkew 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...
benched42 Posted October 2, 2017 Share Posted October 2, 2017 For the original install of the program - is there any way within the software to automate installation? Some parameter or perhaps setting up a TRANFORM file or an "answer" file? This would be better than automating a button click in AutoIt. If you go to IT Ninja you can find out about installation parameters for a lot of different software. Who lied and told you life would EVER be fair? 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