1234567890 Posted May 5, 2020 Posted May 5, 2020 I have a script that I have used for years which starts one of our applications under test, waits for the application window to be active, and then drives the application's UI. I used to be able to use: WinWaitActive ("Application title bar") quite reliably. But then, frequently, but not always, the window didn't become active by itself so the wait never ended. If I clicked on the app title bar, it would becomeactive and the script would proceed. So I modified the script to the following: $DBThwnd = WinWait ("Application title bar") WinActivate ($DBThwnd) WinWaitActive($DBThwnd) This doesn't work any better, however, the application icon on the taskbar becomes highlighted, but the window itself stays not active. This is on Windows 10, 64 bit, Version 1909 and the latest released version of AutoIt. Curiously, when the app icon is highlighted on the taskbar, if I double click to open another application on the desktop, and then close it, then my application window becomes active and the script continues. Clearly, there's something about window activation that I don't understand, but my defense is that it used to work!
Nine Posted May 5, 2020 Posted May 5, 2020 What is the application you are trying to automate ? Maybe you have multiple windows opened simultaneously. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
1234567890 Posted May 5, 2020 Author Posted May 5, 2020 The application is our company's product, a braille translator.
Nine Posted May 5, 2020 Posted May 5, 2020 Can you show an example of the windows/control using autoit info tool ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
1234567890 Posted May 6, 2020 Author Posted May 6, 2020 (edited) I added the following: WinSetState("", "", @SW_MINIMIZE) just before what I was using (which was failing): $DBThwnd = WinWait ("Application title bar") WinActivate ($DBThwnd) WinWaitActive($DBThwnd) and the script reliably continues with the activated window. I'm not at all sure what that WinSetState is doing. Edited May 6, 2020 by 1234567890 new information
1234567890 Posted May 6, 2020 Author Posted May 6, 2020 this isn't a perfect solution--the script does this hundreds of times, but it fails only once every 200 times or so.
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