| || |
Identifying top frame with DP
I've been fooling around with this for some time now, and no luck. Basically, I'm testing a site that makes extensive use of iframes. In my library I have a combination of methods that can find it's way through a dynamic menu structure, of three levels. Application level-->Working Section level-->Form level. The application level frame allows for the working sections to be cached and remain open in a tabbed format (i.e., there's a menu bar at the top of the application frame, and each menu will initially load and later access a cached instance of the working section form. Each working section instance can then load the individual functional forms in a similar manner. Loading the bottom level forms works fine, since they are all unique and easily identified. However, the hundreds of bottom forms are loaded by only 4 or 5 unique working section forms, although multiple instances of these forms occur.
So here's my problem: I use a high-level library to do things like identify frames, elements, button, etc with DP. At one point in the series of methods I'm calling here, I call a function called GetFrameByTitle(title), and pass "Working Section", as this is the title of the iframe at the working section level -- I need this frame to navigate finally down to the bottom level form. Unfortunately, other instances of Working Section are already loaded and open (they are hidden from view but kept cached; clicking the top-level menu button calls some JS to change the style so the user can see the proper Working Section form). Consequently, when I do this:
Set desc = Description.Create
desc("title").Value = title
Set oFrame = TopPage.Frame(desc)
Err.Description tells me that QTP is finding more than one matching frame. Now, I've tried narrowing that down using display, zIndex, CreationTime, focused, but all with no luck. Importantly, indices are dynamically assigned, so I can't refer absolutely using those.
How can I find the frame that is either currently on top or most recently loaded using DP? Thanks,
Re: Identifying top frame with DP
Try Enumerating the Windows and use the instance of that window for the top most.