Jump to content

Recommended Posts

Posted

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,

Posted

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.

Posted

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.

Posted (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 by danwilli
Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...