Forum Discussion

varun_masuraha's avatar
varun_masuraha
Contributor
8 years ago

BrowserWindow() index value is inconsistent

Hi,

I'm using TC v12.10.602.7 with Edge browser.

When I click on a button on my Application, it open a secondary pop-up window and main window gets freezed. Sometimes this window is BrowserWindow(1) with index '1' & sometimes it is BrowserWindow(0) with index '0'.

It's always the front most window, so I'm not able to understand this inconsistency of index value among main window & pop-window.

Attaching 4 screenshots for both situations.

 

Did anyone face such problem ?

 

thanks & regards,

Varun

12 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That index is similar to the index that comes up of there is more than one process running for a desktop application.  It has to do with which process is "top" of the Z-order (again... could be wrong here).

    I'm assuming that you need to be able to find this pop-up browser window in order to interact with it.  So long as the are generally the same window, you could do some sort of check based upon ChildCount, even use NameMapping to map them that way. One BrowserWindow has a childcount of 5, one of 16... that's a more consistent identifying factor than the process index.

    • varun_masuraha's avatar
      varun_masuraha
      Contributor

      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

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        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.