Solai Posted May 24, 2007 Share Posted May 24, 2007 Hi We have an application which is written in VC++. This application window embeds IE using ATL Library class CAxwindow. We have some HTML button in this application.Using AutoIt we try to click on the HTML button,but we can't capture the HTML button. When used Microsoft Spy++ tool it gives the following hierarchy of windows.(Pls see the attached doc).... How can click on the HTML button using AutoIt........Anybody guide me.. Regards, Solai Link to comment Share on other sites More sharing options...
Solai Posted May 24, 2007 Author Share Posted May 24, 2007 Also we try with _IEAttach() function also,but it will throw an error. Help me....... Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 25, 2007 Moderators Share Posted May 25, 2007 You have not provided what you have tried or what errors you get when trying. Without this information no one will be able to help you. Link to comment Share on other sites More sharing options...
karthikeyan Posted May 29, 2007 Share Posted May 29, 2007 Hi, I am Colleague of Solai I was able click on to the HTML button in Embedded IE window, but Iam not able to click on the Message box thrown by the HTML button. I am attaching Code please give your suggestions so that I can click on message box button. I have also attached Screen shot of the application. #include <IE.au3> Run("C:\Documents and Settings\karthikeyanc\Desktop\Test\Test\1\UsingDisc.exe") WinSetOnTop("WebUIEvents","",1) WinActivate("WebUIEvents","") Sleep(1000) $oIE = _IEAttach ("WebUIEvents","Embedded") $button=$oIE.document.getElementById("image1") $button.Click() WinActivate("Nice try!!","You have clicked on HTML image") ControlFocus ("Nice try!!","You have clicked on HTML image",2) ControlClick("Nice try!!","You have clicked on HTML image",2)NiceTry.zip Link to comment Share on other sites More sharing options...
karthikeyan Posted May 29, 2007 Share Posted May 29, 2007 HI, In the code which I have attached "$button.Click()" waits for browser to respond, since browser is not reponding we are not able to proceed to the next line in hte script. Please let me know how to come out after clicking on the button and proceed with the next line. Link to comment Share on other sites More sharing options...
DaleHohm Posted May 29, 2007 Share Posted May 29, 2007 (edited) My guess would be that the Javascript behind the button is such that control is not being returned to AutoIt after the .Click UNTIL you acknowledge the alert dialog. Thus, your WinActivate never gets a chance to run. To work around this you must activate the button without getting sucked into the event processing logic. Fortunately, AutoIt provides you a simple way to do this by sending simulated keyboard strokes: $oIE = _IEAttach ("WebUIEvents","Embedded") $button=$oIE.document.getElementById("image1") $button.focus() Send("{SPACE}") Let us know how you do. Dale Edit: You'll notice that I used SPACE in one example above and ENTER in the other... with buttons you can typically use either, to activate elements like Links you need to use ENTER Edited May 29, 2007 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble 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