Forum Discussion

bhcommunity1's avatar
bhcommunity1
Contributor
4 years ago

Have Multiple Browser Windows open at the same time. (Same browser type, say Firefox)

Just curious to understand how TestComplete works.

 

Say I have 2 firefox browser windows open.  For arguments sake say they are displaying different url values.

Now I have the following line of code.

 

Aliases.browser.Page("*").FindChild(....)

 

So 2 firefox browser windows, no page url reference to work from.  When TestComplete tries to find the child object what does TestComplete do?

 

Would it check both browsers for the child?  Would it only check one?  If only one, what controls which one it looks at?

 

thanks for the info.

 

 

  • Hi,

     

    Would it check both browsers for the child?

    No. Just the first one that meets child's parent search criteria (i.e. browser.Page('*') ).

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Would it check both browsers for the child?

    No. Just the first one that meets child's parent search criteria (i.e. browser.Page('*') ).

     

    • bhcommunity1's avatar
      bhcommunity1
      Contributor

      Ok thanks.  Follow-up question.

       

      "The first one that meets..."  If I continue to have multiple firefox browsers open, and try to refer to an object that exists in one of them (without providing the url reference), is there another way that I could affect which one TestComplete looks at first?

       

      For instance, Start firefox browser1 then start browser2, if I click one of the browsers to make it active/have the focus, would that impact the order that TestComplete searches?  Some sort of browser state, that TestComplete starts with "active browser" for instance? 

       

      Or is the search just random, and happens behind the scenes?

       

      thanks again.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Or is the search just random, and happens behind the scenes?

        Actually, this is a question to Support as I don't know implementation.

        But to my knowledge and experience, the search is random if browser name and/or page url are not specified.

         

        P.S. Is there any reason to not specify browser name and page URL for Aliases? To make them dynamic, you may specify them as project variables and set those variables to required values when starting the browser and navigating to the page.