easier2scriptthan2teach Posted May 23, 2017 Posted May 23, 2017 Hi all, new here love the AutoIT, and looking for some guidance. I am writing a script for an application that runs on multiple computers and I would like to interact with a pop up box that comes up. Problem is that the window comes up with no title and the Class changes from computer to computer, so if I use the class, it would need to be customized for each computer. I would like to initiate action based on the visible text in the window, but am not having luck. Here is what I have, I cannot get the If Winexists to be true and therefore execute the controlclick on NAME:btnOk If WinExists("[TITLE:]", "The Client is having a problem updating one or more status monitors.") Then ;$update = True MsgBox ($MB_OK, "update", "update") ControlClick("","The Client is having a problem updating one or more status monitors.*", "[NAME:btnOk]") Else MsgBox($MB_OK, "update", "update sleeping") sleep(1000) Here is the output from the window info tool: >>>> Window <<<< Title: Class: WindowsForms10.Window.8.app.0.5c39d4_r31_ad1 Position: 0, 0 Size: 518, 202 Style: 0x16800000 ExStyle: 0x00010101 Handle: 0x000308A4 >>>> Control <<<< Class: WindowsForms10.Window.8.app.0.5c39d4_r31_ad1 Instance: 1 ClassnameNN: WindowsForms10.Window.8.app.0.5c39d4_r31_ad11 Name: btnOk Advanced (Class): [NAME:btnOk] ID: 67822 Text: OK Position: 219, 151 Size: 75, 23 ControlClick Coords: 46, 10 Style: 0x56010000 ExStyle: 0x00000000 Handle: 0x000108EE >>>> Mouse <<<< Position: 268, 164 Cursor ID: 0 Color: 0xECECEC >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< The Client is having a problem updating one or more status monitors. Please report this issue immediately to your system administrator before proceeding. Note for the system administrator, please create an Error Report. Once the Error Report has been created, we strongly recommend that you log out, exit the client, and log in again to ensure correct status monitor operation. OK >>>> Hidden Text <<<<
Danp2 Posted May 23, 2017 Posted May 23, 2017 Did you try it like this? If WinExists("[ACTIVE]", "The Client is having a problem updating one or more status monitors.") Then Latest Webdriver UDF Release Webdriver Wiki FAQs
easier2scriptthan2teach Posted May 24, 2017 Author Posted May 24, 2017 I gave that a try, now it is coming back true all the time, even when that error window isn't there.
Danp2 Posted May 24, 2017 Posted May 24, 2017 Perhaps it isn't valid to use the text parameter with the "ACTIVE" title. <Shrug> You stated that the class changes on each installation. Is it consistent enough that you could use REGEXPCLASS? Latest Webdriver UDF Release Webdriver Wiki FAQs
easier2scriptthan2teach Posted May 24, 2017 Author Posted May 24, 2017 I dont think so, however I believe I got it working with If WinExists("", "The Client is having a problem updating one or more status monitors.") Then
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