Forum Discussion
You could capture ALL browser windows. Then cycle through the resulting array of objects and only keep the one with the correct child count?
I'm not sure from all this which window you're actually trying to work with though? If you need to clear the popups in sequence, I suspect you're going to need another way of telling them apart (caption?) in order to isolate them in the correct order.
Hi Colin,
Thx for the reply.
We are trying to maintain generic functions to handle any window, either main or pop-up, by just passing its page object as parameter.
Yes, I have to find an indirect way of getting browser window from browser page. We do get correct page object, but there is no direct way to get its corresponding window as many windows have same childcount.
regards,
Varun
- HKosova8 years agoSmartBear Alumni (Retired)
Why do you need the BrowserWindow object in the first place? If you need to close the window, you can use Page.Close().
- varun_masuraha8 years agoContributor
Hi Helen,
Thanks for the reply.
Your question is very valid. I resorted to using the BrowserWindow object only due to some other issue with TC running on my application with Edge, where I am not able to get correct objects' coordinates in Edge pop-up windows.
So as a workaround I had to use "BrowserWindow(n).Click(Button.Left ± offset, Button.Top ± offset)", while interacting with any buttons inside pop-up.
I tried using page object also, but BrowserWindow worked best.
regards,
Varun
- Colin_McCrae8 years agoCommunity Hero
So, you need to be able to tell two popup windows apart?
Unfortunately, the VM I run TestComplete on is a Win 7 one. So I don't have Edge installed on it. I think you can install Edge on Win 7, but if you're running it on Win 10, I may well not get the same results. So I can't check for myself but .....
Is there no obvious way of telling them apart?
Obviously, IE is different. I just had a quick look at that and an authentication popup does not have it's own BrowserWindow object. There is only one of those. And the Page, BrowserWindow and Popup are all child objects of the IE process. So I guess they've changed how these are presented in Edge.
In IE, the popup has a caption. Does the Edge version not contain something similar? May need to dig down into the child objects a little but I'd hope there was something in there you can use?
I take it of the three "pages" in your last set of screenshots, two of those are actually popup windows? In which case, can you not just use the "Close" method as HKosova suggested? The page objects are always going to be much simpler to tell apart than the BrowserWindow objects. And certainly, the three pages in your screenshot look easy enough to tell apart?
Is this all because of the other issue you linked to? So if you pass it the page, the page finds the button, but fails to click it as the position is reported incorrectly? Any possibility you could use a hotkey instead? (ESC will usually kill a popup window ...)
Related Content
- 2 years agojaredjamieson
- 8 years agoacm
- 6 years agoLAB
Recent Discussions
- 2 days agoMW_Didata