sravan Posted October 9, 2018 Share Posted October 9, 2018 Hi all, controlclick was not able to click the button on a window, though that window and button are existing. The same script contains some more button clicks which are working fyne ,but once this particular window comes the issue is occuring and continuing for other windows as well. Please help us in resolving this issue. current scenario: steps 1 to 10 in the script are working fyne ,only the issue is coming from 11th step on wards, in step11 i was checking for the required window existence and it was existing ,then i was checking for button existence and it was existing and returning the correct button info ("cancel " in my case) then sending "ControlClick" expecting it should click on the cancel button(Button7) and close the window,but it was not happening , window screen is still existing. so taught problem in button7 ,then tried to click on remaining buttons in that window,but the controlclick was not able to click on those buttons also. Even tried to change the function control click in below ways and tried but still the problem exists. ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]") Send("{Space}") or ControlSend("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]","{Space}") or ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]") below is the script: =============================================================================================================== 1.Run("Setup.exe") 2.WinWaitActive("Windows Printer Drivers", "") 3.ControlClick("Windows Printer Drivers", "", "Button1") 4.ControlClick("Windows Printer Drivers", "LICENSE AND LIMITED WARRANTY", "[CLASS:Button; INSTANCE:4]") 5.WinWaitActive("Windows Printer Drivers", "The software will be unpacked to the directory listed below.") 6.ControlClick("Windows Printer Drivers", "The software will be unpacked to the directory listed below.", "[CLASS:Button; INSTANCE:5]") 7.WinWaitActive("Windows Printer Drivers", "After the drivers are unpacked") 8.ControlClick("Windows Printer Drivers", "After the drivers are unpacked", "[CLASS:Button; INSTANCE:8]") 9.WinWaitActive("Seagull Driver Wizard", "This wizard helps you install and remove printer drivers.") 10.Sleep(1000) 11.If WinExists("Seagull Driver Wizard") Then MsgBox($MB_SYSTEMMODAL, "", "Window exists") Else MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Window does not exist") EndIf $text = ControlGetText("Seagull Driver Wizard", "", "Button7") MsgBox(0, "", $text) ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]") =============================================================================================================== Button7 full information: >>>> Window <<<< Title: Seagull Driver Wizard Class: #32770 Position: 709, 326 Size: 503, 389 Style: 0x94C800CC ExStyle: 0x00010101 Handle: 0x0000000000AB14EA >>>> Control <<<< Class: Button Instance: 7 ClassnameNN: Button7 Name: Advanced (Class): [CLASS:Button; INSTANCE:7] ID: 2 Text: Cancel Position: 412, 328 Size: 75, 23 ControlClick Coords: 50, 15 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x0000000000291B90 >>>> Mouse <<<< Position: 1174, 694 Cursor ID: 0 Color: 0xB8B879 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Welcome to the Seagull Driver Wizard This wizard helps you install and remove printer drivers. What would you like to do? Install printer drivers Upgrade printer drivers Remove printer drivers Please save all work and close all applications before proceeding. This process may require Windows to be restarted. < &Back &Next > Cancel >>>> Hidden Text <<<< Finish Help Link to comment Share on other sites More sharing options...
Developers Jos Posted October 9, 2018 Developers Share Posted October 9, 2018 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Share Posted October 9, 2018 (edited) Try with that: Add this at the top of your script Opt("WinTitleMatchMode",2) And then change this : If WinExists("Seagull Driver Wizard") Then by this : If WinExists("Seagull") Then And try again. Also is the window in step 9 and 11 is the same ? Edited October 9, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted October 9, 2018 Share Posted October 9, 2018 Have you considered using command line parameters to control the installation instead of attempting to automate the GUI? https://support.seagullscientific.com/hc/en-us/articles/217079168-Installing-Seagull-drivers-in-silent-automated-mode Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Zedna Posted October 10, 2018 Share Posted October 10, 2018 (edited) Try ControlFocus("Seagull Driver Wizard", "", "Button7") ControlClick("Seagull Driver Wizard", "", "Button7") Or WinWait("Seagull Driver Wizard") WinActivate("Seagull Driver Wizard") WinWaitActive("Seagull Driver Wizard") ControlFocus("Seagull Driver Wizard", "", "Button7") ControlClick("Seagull Driver Wizard", "", "Button7") Edited October 10, 2018 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 Try with that: Add this at the top of your script Opt("WinTitleMatchMode",2) And then change this : If WinExists("Seagull Driver Wizard") Then by this : If WinExists("Seagull") Then And try again. Also is the window in step 9 and 11 is the same ? Hi caramen, Tried ur suggestion ,but still the same issue exists. yes,step 9 and 11 are same,step11 is for cross verifying whether that window exist or not. Regards, sravan Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 Hi Zedna, Even i tried ur suggestion alos,but still that also not working. Regards, sravan. Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 Hi Danp2, As per my use case i have to automate the windows GUI part,can't use command line. Regards, sravan. Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 one thing i forgot to tell u is ,after step8 one pop-up message will be displayed querying "do u want to allow following program to make changes to the computer" ,there am selecting "yes " to proceed further ,then step9 will be executed . so will be there be any issues with the displayed message ? Link to comment Share on other sites More sharing options...
Zedna Posted October 10, 2018 Share Posted October 10, 2018 (edited) Yes, that changes everything. To resolve your issue you have to click on "yes" in pop-up dialog first. Edited October 10, 2018 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 ya i clicked on "yes" button manually waiting for "seagull driver wizard" window in the script (step9), but in that window control clicks are not working (thats wat my issue). Link to comment Share on other sites More sharing options...
caramen Posted October 10, 2018 Share Posted October 10, 2018 (edited) Ok then you have to add this #RequireAdmin at the beginning of your script. It will prompt you one time at start then it will be able to click after. To explain you the reason...: When you start a programme with admin rights you need admin rights to automate it. Or it wont even be able to detect the window and move it etc... (In this case for debug. Please use your initial script with this.) Btw why not consider what said @Danp2 He is the most experienced in this thread atm. Edited October 10, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
sravan Posted October 10, 2018 Author Share Posted October 10, 2018 Thanks a lot caramen,it resolved my issue finally,thank u very much.... Thanks to all for all ur time and the info u provided. 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