Forum Discussion

morde's avatar
morde
Contributor
11 years ago

Open a new browser window function

Hi,



I am trying to write a function to open a new IE window.

I need it to open a NEW window (not a new tab) even if there're other windows open.

Right now I only mannaged to open a new tab.



* Bonus - a function that's relevant to IE, FF & Chrome.



Thanks a lot :)

Mor
    • coffee's avatar
      coffee
      Contributor

      Hi there,

       

      I also have the same question. 

      I added Chrome to my TestedApps list.

      In that CT , I also specified the URL to navigate.

       

      In my script I do like this

       

        x = TestedApps.CT
        x.Run(1,true);

      But it doesn't open a NEW Chrome window , but just opening a new tab in my existing Chrome window. 

      Do I do something wrong here?

       

      Secondly, once the window has been launched , how can I point / control the web elements? 

      Can I do something like 

       

      x.textboxUsername.SetText(username);

      or should I keep using whatever has been mapped in my NameMapping like this ? 

       

      Aliases.browser.XXX.YYY.ZZZ.textboxUsername.SetText(username);

      Thank You

        

       

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        I start mine via their executable with command line switches to open with a locally hosted HTML file which is a basic start page. This HTML file is pretty much a part of any web based project for me.

         

        Reason I do it this way .....

         

        I can always identify the new browser instance easily. It will be the only one displaying the local HTML file. As soon as it is found, it will navigate off somewhere else - from there on in, each browser is identified by it's URL. If they are all required to be on the same URL at the same time, I can see it having problems! (Same URL in two different browser types being OK obviously. But the same URL in two instances of the same browser could get messy) The local file effectively acts as a "marker" to find the newly opened instance. I can have several open at a time, so it's a handy way of doing it. Works with all browsers I use, although the command line swich syntax is different for each obviously.

         

        I regularly have 5 or 6 browser instances open and being interacted with at the same time without problems.