VelvetElvis Posted March 17, 2010 Share Posted March 17, 2010 I have an IE page that contains a frame with an element that I want to click, but can't figure out how, and I have no hair left to pull. Viewing the page source through IE, I see no frames. This is the frame that I need (obtained through Firebug in FF) <frame scrolling="no" src="/cognos/cgi-bin/ppdscgi.exe?FNS=680Fxxxx" marginheight="0" marginwidth="3" name="FT"></frame> This is the element I need to click: <a onmouseout="return(doOver(15,0));" onmouseover="return(doOver(15,1)) ;" href="Javascript:doClick(15)"><img width="24" height="24" border="0" src="http://dsales2.inside.sears.ca/cognos/ppwb/Icon24/savecsv.gif" title="Export CSV" alt="Export CSV" name="savecsv"></a> Problem is, I don't know how to reference it to click it. When I try to get the collection of frames with _IEFrameGetCollection, I get an AutoIt error (The requested action with this object has failed"). I've had pretty good luck automating web pages with simple controls that I can see using IE's "View Source", but am out of my element here. TIA for any help you can provide. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 17, 2010 Share Posted March 17, 2010 Is that frame inside another frame? You might have to drill down to it. What is the full path down to the link, as displayed by a DOM inspector (i.e. DebugBar for IE, or DOM_Inspector for Firefox)? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
VelvetElvis Posted March 18, 2010 Author Share Posted March 18, 2010 (edited) Is that frame inside another frame? You might have to drill down to it. What is the full path down to the link, as displayed by a DOM inspector (i.e. DebugBar for IE, or DOM_Inspector for Firefox)? Here's a small pic below, with the full path from Firebug. Sorry - I couldn't figure out how to just grab the text of this. I should mention that "Frame" is not found anywhere in the actual page source, using the IE context menu item "View Source". I tried to get a reference to the frame with this code I grabbed from the help docs, but it failed with the error I mentioned previously. $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "locationurl")) Next ; fails with "The requested action with this object has failed.:" Thanks for your help! Edited March 18, 2010 by VelvetElvis Link to comment Share on other sites More sharing options...
DaleHohm Posted March 18, 2010 Share Posted March 18, 2010 Add _IEErrorHandlerRegister() to your code so see more info on the COM error. Likely Access is denied. If so you need to open the frame in a new window (see cross domain scripting link in my sig). 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...
PsaltyDS Posted March 18, 2010 Share Posted March 18, 2010 I should mention that "Frame" is not found anywhere in the actual page source, using the IE context menu item "View Source".I should mention you didn't look very close at the path you posted from Firebug: html -head -frameset -frame -frame -html -head -body -form -table ...more table stuff -Your linkThere's a reason people bother to download and use DOM Inspectors, instead just View/Source on their browser.See Dale's post about probably being denied access. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
VelvetElvis Posted March 19, 2010 Author Share Posted March 19, 2010 I should mention you didn't look very close at the path you posted from Firebug: There's a reason people bother to download and use DOM Inspectors, instead just View/Source on their browser.See Dale's post about probably being denied access.I should clarify. I meant just using "View Source". There's no frames mentioned. I knew the frames were in the Firebug output, which evidently displayed code from external links. The only way I could see reference to a frameset was using Firebug and DebugBar. As you've probably guessed, web programming is not my forte. Now to check out Dale's info.Thank you guys. Link to comment Share on other sites More sharing options...
VelvetElvis Posted March 19, 2010 Author Share Posted March 19, 2010 Add _IEErrorHandlerRegister() to your code so see more info on the COM error.Likely Access is denied. If so you need to open the frame in a new window (see cross domain scripting link in my sig).DaleDid as you suggested. You're spot on. Access is denied.Thank you for the help and the article. MouseClick to the rescue. <g> 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