Forum Discussion
Hi Robert,
Thanks for the reply.
I too thought of using childcount check to find the required window, but in one of the situations, there is 2nd pop-window (freezing the main window 'and' 1st pop-up) who has same childcount, hence complicating the situation.
Attaching screenshots for this situation.
Note that we are not using NameMapping.
regards,
Varun
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.
- varun_masuraha9 years agoContributor
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
- HKosova9 years ago
Alumni
Why do you need the BrowserWindow object in the first place? If you need to close the window, you can use Page.Close().
- varun_masuraha9 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