redpicker Posted August 15, 2013 Share Posted August 15, 2013 I need some help with frames in IE. I am working with a page that has several frames. Two of the frames are on top of each other. Frame11 is on top of Frame10. I want to "activate" or bring Frame 10 to the top so my send commands are sent to Frame10, not Frame11. I used to have a script that would switch among multiple frames, but that was years ago and I lost my library of scripts. What do I need to do? Thanks, Link to comment Share on other sites More sharing options...
DW1 Posted August 15, 2013 Share Posted August 15, 2013 Using the _IE functions to populate the fields instead of Send() would be the proper solution. See: _IEFrameGetCollection() and/or _IEFrameGetObjByName() in the helpfile for examples. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
redpicker Posted August 15, 2013 Author Share Posted August 15, 2013 Using the _IE functions to populate the fields instead of Send() would be the proper solution. See: _IEFrameGetCollection() and/or _IEFrameGetObjByName() in the helpfile for examples. Thanks for the suggestion, as it is a good one. I do this whenever I can, but there are some situations where I have to send keyboard commands (control characters, function keys). I would also like to bring the frame I am dealing with visible, so I can see what is going on. OK, perhaps that isn't absolutely necessary, but it really helps, particularly since I don't really know what I am doing. I know there is a simple way of doing this, I had figured it out a few years ago (by going through the help files), but I am coming up blank now. Link to comment Share on other sites More sharing options...
DW1 Posted August 15, 2013 Share Posted August 15, 2013 (edited) In this case I would still use the IE functions to accomplish the focus you are looking for then use Send() if needed. You would get the frame, get the element, then use _IEAction() to set the "focus" on the element, then you could use Send() now that you know where the focus is. Is this for a game? Edited August 15, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
redpicker Posted August 15, 2013 Author Share Posted August 15, 2013 No, this is not for a game, it's work. I am trying to automate data entry into our ERP system through a IE HTML-based interface that opens multiple frames for different screens. In performing the data entry, I have to switch between screens, which I have discovered are different Frames in IE using the IE udfs you mentioned above (and others) and a lot of trial and error. I have tired calling focus to an element on the inactive frame, but that does not work. Link to comment Share on other sites More sharing options...
redpicker Posted August 20, 2013 Author Share Posted August 20, 2013 I realize that bumping your own thread is frowned upon, but it's been several days. Somebody must know how to activate a frame in a IE window? Thanks, Link to comment Share on other sites More sharing options...
dragan Posted August 20, 2013 Share Posted August 20, 2013 (edited) Try one of these:http://msdn.microsoft.com/en-us/library/ie/ms535258(v=vs.85).aspx I would suggest: .activate or .setActive To the iFrame object variable, as in: $oiFrame.activate Edited August 20, 2013 by dragan Link to comment Share on other sites More sharing options...
redpicker Posted August 21, 2013 Author Share Posted August 21, 2013 I tried $oFrame.activate before I posted. It just produces an error --------------------------- AutoIt Error --------------------------- Line 50 (File "M:AutoIt FolderFrame Tester.au3"): $oFrame10.Activate $oFrame10.Activate^ ERROR Error: The requested action with this object has failed. --------------------------- OK --------------------------- using $oFrame10.setActive produces the same result. I am really annoyed with myself. I had this figured out a year ago or so, but between a computer upgrade and HD crash, I'm having to re-write my old scripts and I can't figure out what I did to do this. Thanks for the suggestions. If I figure it out, I'll post what I did. My work around now is just to have a different script for each frame and manually switch between frames once the first script finsihes and before I launch the second one. Not very efficient, but at least it gets the job done. 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