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
I have problem during running recorded test in WebUi Test Studio QA Edition. When I running previously recorded test after executing few steps i get following message: "Are you sure you want to navigate away from this page? Leaving or refreshing this page can result in date loss. Press OK to continue, or Cancel to stay on the current page."
This message doesn't appear during recording test, but always appears after running tests. Does somebody know how to avoid appearing of this message? This message appears when user reload current page or want to close tab or browser, but I didn't do any of these two actions during recording test.
Thanks in advance...
Tony
<
td
class
=
"dr-dscr-button rich-datascr-button"
onclick
=
"Event.fire(this, 'rich:datascroller:onscroll', {'page': 'fastforward'});"
>»</
td
>
var forward = (from b
in
Manager.ActiveBrowser.Find.AllControls<HtmlControl>() where b.ToString().Contains(
"»"
) select b);
Console.WriteLine(forward.Count().ToString());
HtmlControl forward = Manager.ActiveBrowser.Find.ByXPath<HtmlControl>(
"//tr/td[text()=\"»\"]"
);