tdsnaidu Posted June 19, 2007 Share Posted June 19, 2007 Hi Guys, I am new to AutoIt, any help will be greatly appreciated. I am trying to automate following: 1) Selecting a web page from favourites 2) Selecting a web page from history 3) Automating Google toolbar search I have written following script: #include <IE.au3> $oIE = _IECreate ("localhost/Page1.html") Sleep( 2000 ) ; launch URL from different plugin ie google toolbar For $i = 2 to 1 Step -1 Send("{TAB}") Next Sleep( 2000 ) Send("Microsoft") Sleep( 2000 ) Send("{ENTER}") Sleep( 2000 ) ; Select URL from favourites Send( "^i" ) Sleep( 2000 ) Send("{DOWN}") Sleep( 2000 ) Send("{ENTER}") Sleep( 2000 ) Send( "^i" ) Sleep( 2000 ) ; open URL in new window For $i = 3 to 1 Step -1 Send("{TAB}") Next Sleep( 2000 ) Send("{ENTER}") Sleep( 2000 ) Send("!{F4}") Sleep(2000) ;select URL from history Send( "^h" ) Sleep( 2000 ) Send("{ENTER}") Sleep( 2000 ) Send( "^h" ) Sleep( 2000 ) _IEQuit ($oIE) This script works fine for me as long as i keep the active window as IE launched by AutoIt, I have to run this script with nightly build and my program crashes when i am trying to use the above script with nightly builds. Please let me know if there is any alternative solution available???? Thanking you in anticipation Link to comment Share on other sites More sharing options...
GMK Posted June 19, 2007 Share Posted June 19, 2007 (edited) I think it would be easier to just navigate to the addresses, rather than select them from your favorites. EDIT: To clarify, use _IENavigate and navigate to the URLs. Edited June 19, 2007 by GMK Link to comment Share on other sites More sharing options...
tdsnaidu Posted June 19, 2007 Author Share Posted June 19, 2007 I think it would be easier to just navigate to the addresses, rather than select them from your favorites.I am trying to automate manual testing, as per test case i have to select from favourites. Link to comment Share on other sites More sharing options...
DaleHohm Posted June 19, 2007 Share Posted June 19, 2007 "my program crashes" is not a very precise description of your trouble. I therefore cannot give you any precise advice other than to suggest you look into using ControlSend instead of Send to avoid issues with window focus. Dale 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...
tdsnaidu Posted June 19, 2007 Author Share Posted June 19, 2007 I tried using ControlSend but it is failing to select the enter button in the second ControlSend call from the below script #include <IE.au3> $oIE = _IECreate ("localhost/Page1.html") Sleep( 2000 ) ; launch URL from different plugin ie google toolbar For $i = 2 to 1 Step -1 ControlSend("http://localhost/Page1.html - Microsoft Internet Explorer","","Search Box1","{TAB}") Next Sleep( 2000 ) ControlSend("http://localhost/Page1.html - Microsoft Internet Explorer","","Search Box1","{ENTER}") Link to comment Share on other sites More sharing options...
AutoItKing Posted June 19, 2007 Share Posted June 19, 2007 (edited) I think it would be great if you tried out the [ autoit ] [ /autoit ] tags. (remove the spaces) Edited June 19, 2007 by AutoItKing http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script] Link to comment Share on other sites More sharing options...
DaleHohm Posted June 19, 2007 Share Posted June 19, 2007 Perhaps you're sending to the wrong control... I presume you are trying to do something like this: #include <IE.au3> $oIE = _IECreate() $hwnd = _IEPropertyGet($oIE, "hwnd") ControlSend($hwnd, "", "[CLASS:ATL:03167AF8; INSTANCE:1]", "FooBar") Sleep(100) ControlSend($hwnd, "", "[CLASS:ATL:03167AF8; INSTANCE:1]", "{ENTER}") Dale 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...
DW1 Posted June 19, 2007 Share Posted June 19, 2007 needing that many sleeps is typicaly a sign of a script that needs to be rewritten IMO AutoIt3 Online Help 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