This is a migrated thread and some comments may be shown as answers.

IE9 - New Browser (via target="_blank")

1 Answer 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grim
Top achievements
Rank 1
Grim asked on 27 Jan 2012, 01:19 AM
Hi,

I am testing a website and one of the links is target="_blank". In IE9, this creates a brand new Browser Instance, not a popup. As a result, the following approaches do not work:

1. Manager.Browsers.Count remains equal to one forever (I can test this using long timeouts
2. Wait for IEConnect does not work because the new window is not a popup. It is a new browser.
3. Manager.WaitForNewBrowserConnect(url) does not work. The new browser is not a popup per se, it's a brand new browser window so it does not seem to be associated with ActiveBrowser (like popups are).

So my questions are:

1. In IE9, when I click a target="_blank" and a brand new browser window appears, how do I get hold of it within the Telerik Framework?
2. Can I get hold of an already-running-browser instance that I did not spawn within Telerik?

Thanks for your help!

Grim

1 Answer, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 27 Jan 2012, 04:25 PM
Hello Graham,

There is no difference between a new browser instance and a standard HTML popup window as far as the Telerik Testing Framework is concerned. See here for more information.

Here is sample code written against a local HTML file that contains the following link in it:

<a href="http://www.bing.com" target="_blank" id="bing">Bing Popup</a>

Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo("c:\\html\\popup.html");
 
Manager.SetNewBrowserTracking(true);
 
Find.ById<HtmlAnchor>("bing").Click();
 
Manager.WaitForNewBrowserConnect("http://www.bing.com", true, 3000);
Manager.SetNewBrowserTracking(false);
 
Assert.IsTrue(Manager.Browsers.Count == 2);
Assert.IsTrue(ActiveBrowser.Url.Contains("http://www.bing.com"));
Find.ById<HtmlInputText>("sb_form_q").Text = "Telerik";
Find.ById<HtmlInputSubmit>("sb_form_go").Click();
 
ActiveBrowser.Close();
 
Assert.IsTrue(Manager.Browsers.Count == 1);
Assert.IsTrue(ActiveBrowser.Url.Contains("popup.html"));

1. Give the above approach a try in your environment.

2. No, this is not possible.

Kind regards,
Anthony
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Grim
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Share this question
or