5 Answers, 1 is accepted
0
Hello kiran,
Is there a specific messagebox dialogue controkl type you are refering to? Silverlight Child Window and Popup windows should be covered by this blog. If you can post back with an online example or documentation, I can try to see what we can try.
Regards,
Nelson
the Telerik team
Is there a specific messagebox dialogue controkl type you are refering to? Silverlight Child Window and Popup windows should be covered by this blog. If you can post back with an online example or documentation, I can try to see what we can try.
Regards,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kiran
Top achievements
Rank 2
answered on 30 Jun 2010, 10:35 AM
Hi Nelson,
I am taking about
MessageBox.Show("Hello World !!!!!!!!", "Message");
Thanks
Kiran
I am taking about
MessageBox.Show("Hello World !!!!!!!!", "Message");
Thanks
Kiran
0
Hello again kiran,
Thanks for clearing that up, for Custom Win32 dialogs you can use the Generic Handlers in the WebAii Framework as described in this documentation.
But if you are using WebUI Dev Edition recording, you can add a Generic Dialog handler from the 'Dialogs...' drop down in the Steps Tab. Please see pages 34-35 in the Dev Edition Quick Start Guide for reference.
Sincerely,
Nelson
the Telerik team
Thanks for clearing that up, for Custom Win32 dialogs you can use the Generic Handlers in the WebAii Framework as described in this documentation.
But if you are using WebUI Dev Edition recording, you can add a Generic Dialog handler from the 'Dialogs...' drop down in the Steps Tab. Please see pages 34-35 in the Dev Edition Quick Start Guide for reference.
Sincerely,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Prashant
Top achievements
Rank 1
answered on 10 Feb 2011, 01:57 PM
Hi Cody,
We tried the solution that you have given and it works fine.
But we also want to verify the error message text on message box. Can you please help us in this.
Thanks,
Madhav
We tried the solution that you have given and it works fine.
But we also want to verify the error message text on message box. Can you please help us in this.
Thanks,
Madhav
0
Hi Madhav,
All the best,
Cody
Yes. Here is a complete working sample test:
[TestMethod]
public
void
VerifyAlertDialogText()
{
// Load our webpage in the browser
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo(
"http://www.w3schools.com/JS/tryit.asp?filename=tryjs_alert"
);
// Initialize custom 'Alert' dialog handler
AlertDialog alertDialog =
new
AlertDialog(ActiveBrowser, DialogButton.OK);
alertDialog.HandlerDelegate = MyCustomAlertHandler;
Manager.DialogMonitor.AddDialog(alertDialog);
// Click that
ActiveBrowser.Frames[
"view"
].RefreshDomTree();
ActiveBrowser.Frames[
"view"
].Find.ByExpression<HtmlInputButton>(
"value=Show alert box"
,
"tagname=input"
).Click();
// Wait Until Dialog is Handled.
alertDialog.WaitUntilHandled(5000);
}
/// <summary>
/// Custom alert dialog hander to read and verify the text
/// </summary>
/// <param name="dialog">The alert dialog to validate</param>
public
void
MyCustomAlertHandler(IDialog dialog)
{
string
txt = dialog.Window.AllChildren[dialog.Window.AllChildren.Count - 1].Caption;
Assert.AreEqual<
string
>(
"Hello! I am an alert box!"
, txt);
Log.WriteLine(txt);
Window okButton = WindowManager.FindWindowRecursively(dialog.Window.Handle,
"OK"
,
false
, 0);
Manager.Desktop.Mouse.Click(MouseClickType.LeftClick, okButton.Rectangle);
dialog.HandleCount++;
}
Cody
the Telerik team