DuncanM Posted October 10, 2006 Share Posted October 10, 2006 I'm automating the configuration of a device via web browser, which has 2 frames (left and right). In the right frame, I wish to click on the "RESET" button. The following is the code I've implemented thus far: $oIE = _IECreate ("https://192.168.2.1", 0, 1, 0) $leftFrame = _IEFrameGetCollection($oIE, 1) $rightFrame = _IEFrameGetCollection($oIE, 2) $resetForm = _IEFormGetCollection($rightFrame, 0) $resetButton = _IEFormElementGetObjByName($resetForm, "Reset") $resetButton.click When I execute this code, it does click the RESET button, which displays a Microsoft Internet Explorer dialog box asking "Are you sure you want to proceed?" (OK/CANCEL). The problem I'm having is that I am unable to send anything to this dialog box. I have tried ControlClick and Send, none of which work. In addition, _IEFormSubmit($resetForm, 0) does nothing. I'm so close to finishing this function..what am I doing wrong here? Link to comment Share on other sites More sharing options...
Valuater Posted October 10, 2006 Share Posted October 10, 2006 IIRC Send("{TAB}") once or twice to get to the button you want Send("{ENTER}") Should work 8) Link to comment Share on other sites More sharing options...
DuncanM Posted October 10, 2006 Author Share Posted October 10, 2006 IIRCSend("{TAB}") once or twice to get to the button you wantSend("{ENTER}")Should work8)Hi Valuater - I tried 1 tab, 2 tabs, no tabs..still no joy (dialog box remains).. Link to comment Share on other sites More sharing options...
DuncanM Posted October 10, 2006 Author Share Posted October 10, 2006 Is there some way to tell the script to return immediately and not wait for the dialog to close? I'm doing it for $oIE, but I don't see any way to do so at the end of the script.. Link to comment Share on other sites More sharing options...
DuncanM Posted October 11, 2006 Author Share Posted October 11, 2006 Getting desperate for a solution..any ideas?? Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 Could Send("{TAB}") and Send("{ENTER}") be not working because AutoIT is waiting for the box to close? If so how can I disable this so I can interact with it? Link to comment Share on other sites More sharing options...
this-is-me Posted October 12, 2006 Share Posted October 12, 2006 You may need an adlib statement: If WinExists("Microsoft Internet Explorer", "sure?") Then ControlClick("Microsoft Internet Explorer", "sure?", "&Yes") EndIf Who else would I be? Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 Ok, when I do Opt('TrayIconDebug', 1), I can see that it stops when at the WinWait('Microsoft Internet') line (i.e. when it waits for the "Microsoft Internet Explorer" dialog box to appear). This would prove that it's not recognizing this window, so I desperately need a way to send something to it! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 12, 2006 Moderators Share Posted October 12, 2006 Have you tried WinSearchChildren? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 Have you tried WinSearchChildren?Smoke - I'm not familiar with WinSearchChildren. How is this implemented? I can't seem to find any documentation on it. Thanks. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 12, 2006 Moderators Share Posted October 12, 2006 Smoke - I'm not familiar with WinSearchChildren. How is this implemented? I can't seem to find any documentation on it. Thanks.Look in Opt(). I told you to do this in the last thread that you brought up on the same subject. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
this-is-me Posted October 12, 2006 Share Posted October 12, 2006 @DuncanM, I did not intend for this to be a ready-made answer to your problem. You will need to change/modify my example to fit your circumstance. Use the Au3 Window Info to learn more. Who else would I be? Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 Look in Opt(). I told you to do this in the last thread that you brought up on the same subject.I added the following at the beginning of the script after Opt('TrayIconDebug', 1): Opt('WinSearchChildren', 1) I still can't seem to interact with the window (tried Send and ControlClick).. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 12, 2006 Moderators Share Posted October 12, 2006 (edited) I added the following at the beginning of the script after Opt('TrayIconDebug', 1): Opt('WinSearchChildren', 1) I still can't seem to interact with the window (tried Send and ControlClick)..No site for us to test with, ... to be honest, I'm quite tired of the guessing game... GL Edited October 12, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 @DuncanM, I did not intend for this to be a ready-made answer to your problem. You will need to change/modify my example to fit your circumstance. Use the Au3 Window Info to learn more. Thanks - I modified it using the following: ControlClick("Microsoft Internet Explorer", "", "Button1") Still nothing though.. Link to comment Share on other sites More sharing options...
this-is-me Posted October 12, 2006 Share Posted October 12, 2006 It should be obvious you will also need to change the WinExists function. Who else would I be? Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 It should be obvious you will also need to change the WinExists function.Correct - after I have it click on the RESET button and the dialog box appears, I now have the following code: Sleep(1500) If WinExists("Microsoft Internet Explorer", "Are you sure") Then ControlClick("Microsoft Internet Explorer", "Are you sure", "Button1") EndIf However, it still does not seem to be recognizing the window, even with WinChildExists set to 1. The debug says it's hung up on a Sleep line, but I can clearly see it's getting past that.. Link to comment Share on other sites More sharing options...
DuncanM Posted October 12, 2006 Author Share Posted October 12, 2006 Ok, I threw in some diagnostic MsgBox lines, and I've confirmed that it's definitely waiting for the main page to return before it continues the script (i.e. until the OK/CANCEL dialog box closes). When I issue the "click", is there a way to tell AutoIT not to wait till the page loads? Amazing how something that should be so simple gets so complex. Link to comment Share on other sites More sharing options...
this-is-me Posted October 13, 2006 Share Posted October 13, 2006 Did't I just say the word adlib somewhere? Who else would I be? Link to comment Share on other sites More sharing options...
DuncanM Posted October 13, 2006 Author Share Posted October 13, 2006 Did't I just say the word adlib somewhere?Hmm..how would you use adlib in this case? I looked at the help file, but didn't see any way to make it work in this scenario. Thanks again. 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