From Telerik demo-page (http://demos.telerik.com/aspnet-ajax/window/examples/radopen/defaultcs.aspx) I copied the following code (basically two buttons, one opening the browser´s popup, the other opening a RadWindow-popup):
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
<Windows>
<telerik:RadWindow
id="RadWindow1"
runat="server"
showcontentduringload="false"
width="400px"
height="400px"
title="Telerik RadWindow"
behaviors="Default">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<table style="width: 100%;">
<tr>
<td id="DecoratedControlsContainer">
<script type="text/javascript">
//<![CDATA[
function openRadWin() {
radopen("http://www.telerik.com", "RadWindow1");
}
function openPopUp() {
window.open("http://www.telerik.com", "WindowPopup", "width=400px, height=400px, resizable");
}
//]]>
</script>
<button style="width: 150px; margin-bottom: 3px;"
onclick="openRadWin(); return false;" id="openrad">open RadWindow</button><br style="clear:both" /><br style="clear:both" />
</td>
<td style="width: 50px;">
</td>
<td style="vertical-align: top; border-left: 1px solid #cccccc; padding-left: 40px;">
<button style="width: 170px; margin-bottom: 3px;"
onclick="openPopUp(); return false;" id="openpopup">open browser's popup</button><br style="clear:both" /><br style="clear:both" />
</td>
</tr>
</table>
Then i created two webaii-tests:
[TestMethod]
public void OpenPopup()
{
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo("http://localhost:38518");
Manager.SetNewBrowserTracking(true);
Find.ById<HtmlButton>("openpopup").Click();
Manager.WaitForNewBrowserConnect("http://www.telerik.com", true, 10000);
Manager.SetNewBrowserTracking(false);
Assert.AreEqual(2, Manager.Browsers.Count);
}
[TestMethod]
public void OpenRad()
{
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo("http://localhost:38518");
Manager.SetNewBrowserTracking(true);
Find.ById<HtmlButton>("openrad").Click();
Manager.WaitForNewBrowserConnect("http://www.telerik.com", true, 10000);
Manager.SetNewBrowserTracking(false);
Assert.AreEqual(2, Manager.Browsers.Count);
}
Only the test OpenPopup passes.
The test OpenRad throws exception due to WaitforNewBrowserConnect times out.
Grateful for any help because I really need to be able to test RadWindow-popups.
//Erik Lindahl