candyania Posted May 19, 2010 Posted May 19, 2010 I tried to use controlclick to click "Yes" button in an Alert Warning window, code is like: WinWait("Security Warning"); WinActivate("Security Warning"); ControlClick("Security Warning", "","Yes"); what's weird is it cannot work for Yes button, but work well for No button...if change code as: WinWait("Security Warning"); WinActivate("Security Warning"); ControlClick("Security Warning", "","No"); and I also tried ControlClick("Security Warning", "","[CLASS:Button; INSTANCE:1]");//Yes button is the first button in the alert window but still cannot work successfully to click Yes button. Do anyone know the reason why??
JohnOne Posted May 19, 2010 Posted May 19, 2010 What are the contents of the window info tool? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
candyania Posted May 19, 2010 Author Posted May 19, 2010 (edited) What are the contents of the window info tool?i don't know whether you mean ie develop tool bar as you mentioned window info tool, but it cannot work when there is popup alert window, when i tried to use the tool, always ask me to click alert window first Edited May 19, 2010 by candyania
JohnOne Posted May 19, 2010 Posted May 19, 2010 (edited) To display a picture you first need to upload it to an image host. For example http://photobucket.com/ there are many more, can you not just paste the text of the summary? Edited May 19, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
candyania Posted May 19, 2010 Author Posted May 19, 2010 (edited) To display a picture you first need to upload it to an image host.For example http://photobucket.com/there are many more, can you not just paste the text of the summary?Check the screenshot here: Edited May 19, 2010 by candyania
JohnOne Posted May 19, 2010 Posted May 19, 2010 In your Autoit v3 start menu folder there should be a program called window info. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Juvigy Posted May 19, 2010 Posted May 19, 2010 This looks like IE security window. You can configure IE to not display such warnings. Put the original site in the trusted zone - this may solve your issue.
candyania Posted May 19, 2010 Author Posted May 19, 2010 I have checked the button with window info tool, and the Yes button is instance:2, so i modified code as: ControlClick("Security Warning", "","[CLASS:Button; INSTANCE:2]"); However, i can see the focus moved to Yes button, but seems there is no Click action...don't understand why Info grabbed by tool show as: Class Button Instance 2 ClassnameNN Button2 Advanced Mode [CLASS:Button; INSTANCE:2] ID 1 Text Yes
candyania Posted May 19, 2010 Author Posted May 19, 2010 (edited) I have checked the button with window info tool, and the Yes button is instance:2, so i modified code as: ControlClick("Security Warning", "","[CLASS:Button; INSTANCE:2]"); However, i can see the focus moved to Yes button, but seems there is no Click action...don't understand why Info grabbed by tool show as: Class Button Instance 2 ClassnameNN Button2 Advanced Mode [CLASS:Button; INSTANCE:2] ID 1 Text Yes More info of this button: Advanced Mode [CLASS:Button; INSTANCE:2] ID 1 Text Yes Position 215,96 I tried to locate the Yes button by adding x, y like: ControlClick("Security Warning", "","[CLASS:Button; INSTANCE:2]",,215,96); but seems the format is not correct, function reference for controlclick is like: ControlClick("title","text",controlID [, button [, clicks [, x[, y]]]]) do anyone know how to resolve this? Edited May 19, 2010 by candyania
candyania Posted May 19, 2010 Author Posted May 19, 2010 This looks like IE security window.You can configure IE to not display such warnings.Put the original site in the trusted zone - this may solve your issue.I do add the site into my trust list, but still the warning msg will popup.
JohnOne Posted May 19, 2010 Posted May 19, 2010 post your code you are trying, in autoit tags[autoit]your code here[/autoit]Also try a double click AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Juvigy Posted May 19, 2010 Posted May 19, 2010 On the security window there are 2 sites. THe second one is in your trust list but are you sure the first one is there?
JohnH Posted September 17, 2010 Posted September 17, 2010 I have a similar issue. Here is my code: ShellExecuteWait("folder\file.reg") WinWait("[Class:#32770]") WinActivate("[Class:#32770]") ControlClick("[Class:#32770]", "","[CLASS:Button; INSTANCE:1]"); I also tried with the name of the window - "Registry editor" instead of the class, but still nothing happens. What I'm trying to do: -Use ShellExecuteWait in order to run a reg file - this works fine -When the Registry Editor confirmation window appears "Are you sure you want to add the information .... into the registry" I want to click on the Yes Button, but using the above code has no results.
LurchMan Posted September 17, 2010 Posted September 17, 2010 (edited) Usually with the security warnings I've found that the program that launched it cannot click the buttons - So I just create a simple While...WEnd loop in another script compile it and call it before that security warning appears. Its not the best solution but it works. Edit: And for John H - Change ShellExecuteWait to just ShellExecute - The msgbox is still considered part of the program you told it to run so AutoIT won't continue until the MsgBoxs are gone. Edited September 17, 2010 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.
JohnH Posted September 17, 2010 Posted September 17, 2010 Hey LurchMan, Thanks for the tip. It's working fine now.
LurchMan Posted September 17, 2010 Posted September 17, 2010 Hey LurchMan,Thanks for the tip.It's working fine now.For future reference as well, Don't piggy back on a topic with your issue - they weren't quite the same. Just create a new post next time. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.
JohnH Posted September 17, 2010 Posted September 17, 2010 Yup, you're right. I'll do that. candyania's issue was related to a Alert Warning Window, mine window was a simple one. Thanks, John
mfsiSudhansu Posted October 22, 2013 Posted October 22, 2013 Hi John, I am very new to Autoit. I was having a problem(see the attachment) while handling the java security warning popup window but it is fixed now using the below code. I am able to click on Allow button using the below code. ShellExecuteWait("folder\file.reg") WinWait("[Class:#32770]") WinActivate("[Class:#32770]") ControlClick("[Class:#32770]", "","[CLASS:Button; INSTANCE:1]"); But my question is : I want to verify whether that warning popup window is coming or not in the page using "if" condition. If it will come then only i will click on Allow otherwise no need to click on simply ignore. Can anyone please suggest me How to accomplish this? With Best Regards, Sudhansu.
water Posted October 22, 2013 Posted October 22, 2013 Welcome to AutoIt and the forum! This thread is more than 3 years old and the user hasn't been active for 2 1/2 years. So I suggest not to necro such an old thread but to open a new one My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Bert Posted October 22, 2013 Posted October 22, 2013 The Vollatran project My blog: http://www.vollysinterestingshit.com/
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