public
class
VisualColourPicker : RadColorPicker
{
}
This however now gives me. An error of "Unable to cast object of type 'ArtOfTest.WebAii.Controls.Xaml.Wpf.SolidColorBrush' to type 'ArtOfTest.WebAii.Silverlight.UI.Brush'." So I had to change my property code above to the following to get the selected colour.public
ArtOfTest.WebAii.Controls.Xaml.Wpf.Color CustomSelectedColor
{
get
{
var but =
this
.Find.ByName<ArtOfTest.WebAii.Controls.Xaml.Wpf.Button>(
"ButtonPart"
);
var rec = but.Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Rectangle>();
return
(rec.Fill
as
ArtOfTest.WebAii.Silverlight.UI.SolidColorBrush).Color;
}
}
Is there a reason why 1: simply VisualColourPicker.SelectedColor does not work out of the box in that its looking for some "LeftButton"var but =
this
.Find.ByName<ArtOfTest.WebAii.Controls.Xaml.Wpf.Button>(
"ButtonPart"
);
var rec = but.Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Rectangle>();
var fill = (ArtOfTest.WebAii.Controls.Xaml.Wpf.SolidColorBrush)rec.GetProperty(
new
ArtOfTest.WebAii.Silverlight.AutomationProperty(
"Fill"
,
typeof
(ArtOfTest.WebAii.Controls.Xaml.Wpf.SolidColorBrush)));
return
fill.Color;
2: When I try and get the colour with myown property that the out of box Fill property then fails in an internal cast. Thanks
Unable to download the excel file from 'Download Dialog' in IE
Please find below code and also please find attached screen shot for the dialog box.
My System Configuration: VSTS 2012, Telerik Test Framework( Nunit template) ,Window7 and IE9.
namespace TestProject2
{
public class TelerikNUnitTest1 : BaseTest
{
public void SampleWebAiiTest()
{
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo("http://192.168.10.65/Login.aspx");
string saveLocation = string.Format("address-{0:HH-mm-ss}.xls", DateTime.Now);
//Create dialogs
IEDownloadDialog part1 = new IEDownloadDialog(ActiveBrowser, DialogButton.SAVE, Manager.Desktop);
Manager.DialogMonitor.Start();
SaveAsDialog part2 = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE, @"C:\Users\1029\Desktop\ExportTest" + saveLocation, Manager.Desktop);
IEDownloadCompleteDialog part3 = new IEDownloadCompleteDialog(ActiveBrowser, DialogButton.CLOSE, Manager.Desktop);
//Add each dialog to the monitor
Manager.DialogMonitor.AddDialog(part1);
Manager.DialogMonitor.AddDialog(part2);
Manager.DialogMonitor.AddDialog(part3);
System.Threading.Thread.Sleep(30000);
Manager.ActiveBrowser.RefreshDomTree();
//Clicking on below button ‘Save Dialog’ will open
Find.ById<HtmlInputImage("ctl00_ctl00_PageContentPlaceHolder_PageContentPlaceHolder_TrademarkSearchSearchResults_ExportExcelButton").Click();
Manager.ActiveBrowser.RefreshDomTree();
ActiveBrowser.WaitUntilReady();
part1.WaitUntilHandled();
part2.WaitUntilHandled(30000);
part3.WaitUntilHandled(30000);
System.Threading.Thread.Sleep(10000);
System.Threading.Thread.Sleep(10000);
}
}
}
I am getting below exception in debug mode for'part1.WaitUntilHandled();' code line
‘Time Out Exception was unhandled by user code. Time Out waiting ‘60000’ msec. for any dialog to be handled.
And In Run mode below trace is observed
[Trace] : Unexpected dialog encountered. Closing the dialog, and halting execution.
Please help me how to save excel file from IE9 download dialog and also please find attached screen shot for dialog box.