public void SilverlightModuleCLoadedOnDemand() { AutomationElement aeModuleC = ModularityPage <SilverlightAppLauncher> .ModuleCContent; Thread.Sleep(1000); Assert.IsNotNull(aeModuleC); //Get the clickable point and click on it. System.Windows.Point point = new System.Windows.Point(aeModuleC.Current.BoundingRectangle.X + aeModuleC.Current.BoundingRectangle.Width / 2, aeModuleC.Current.BoundingRectangle.Y + aeModuleC.Current.BoundingRectangle.Height / 2); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)point.X, (int)point.Y); Thread.Sleep(2000); MouseEvents.Click(); MouseEvents.Click(); Thread.Sleep(1000); System.Windows.Point point1 = new System.Windows.Point(aeModuleC.Current.BoundingRectangle.Width / 2, aeModuleC.Current.BoundingRectangle.Height / 2); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)point1.X, (int)point1.Y); Thread.Sleep(1000); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)point.X, (int)point.Y); Thread.Sleep(1000); AutomationElement aeModCtooltip = ModularityPage <SilverlightAppLauncher> .IntializedModuletooltip; Assert.IsFalse(aeModCtooltip.Current.IsOffscreen, "Module C Tooltip is offscreen"); }
//[Ignore] public void DesktopLoadModuleFAndDependency() { //Check if Module F is already loaded AutomationElement aeModuleF = ModularityPage <WpfAppLauncher> .ModuleF; AutomationElement aeClickToloadModuleF = aeModuleF.FindElementByContent(new ResXConfigHandler(ConfigHandler.GetValue("ControlIdentifiersFile")).GetValue("ClickToLoadTextBlock")); Assert.IsFalse(aeClickToloadModuleF.Current.IsOffscreen, "Module F is initialized"); //Get the clickable point and click on it. System.Windows.Point clickablePoint = aeModuleF.GetClickablePoint(); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)clickablePoint.X, (int)clickablePoint.Y); Thread.Sleep(1000); MouseEvents.Click(); Thread.Sleep(1000); //Check if depency module (Module E) is loaded AutomationElement aeModuleE = ModularityPage <WpfAppLauncher> .ModuleE; AutomationElement aeClickToloadModE = aeModuleE.FindElementByContent(new ResXConfigHandler(ConfigHandler.GetValue("ControlIdentifiersFile")).GetValue("ClickToLoadTextBlock")); Assert.IsTrue(aeClickToloadModE.Current.IsOffscreen, "Module E is not initialized"); //Check if Module F is loaded AutomationElement aeClickToloadModF = aeModuleF.FindElementByContent(new ResXConfigHandler(ConfigHandler.GetValue("ControlIdentifiersFile")).GetValue("ClickToLoadTextBlock")); Assert.IsTrue(aeClickToloadModF.Current.IsOffscreen, "Module F is not initialized"); }
public static void SelectContactAvatarsOptions() { //Find Calendar radio button and click on it AutomationElement aeContactAvatarsButton = ViewSwitchingNavigationPage <TApp> .ContactAvatarsButton; aeContactAvatarsButton.Select(); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)aeContactAvatarsButton.GetClickablePoint().X, (int)aeContactAvatarsButton.GetClickablePoint().Y); System.Threading.Thread.Sleep(TIMEWAIT); MouseEvents.Click(); Thread.Sleep(TIMEWAIT); }
public static void SelectEmailOption() { //Find Email radio button and click on it AutomationElement aeMailButton = ViewSwitchingNavigationPage <TApp> .EMailButton; aeMailButton.Select(); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)aeMailButton.GetClickablePoint().X, (int)aeMailButton.GetClickablePoint().Y); System.Threading.Thread.Sleep(1000); MouseEvents.Click(); Thread.Sleep(2000); }
public void SilverlightLoadModuleFAndItsDependency() { AutomationElement aeModuleF = ModularityPage <SilverlightAppLauncher> .ModuleFContent; Thread.Sleep(1000); Assert.IsNotNull(aeModuleF); //Get the clickable point and click on it. System.Windows.Point pointF = new System.Windows.Point(aeModuleF.Current.BoundingRectangle.X + aeModuleF.Current.BoundingRectangle.Width / 2, aeModuleF.Current.BoundingRectangle.Y + aeModuleF.Current.BoundingRectangle.Height / 2); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)pointF.X, (int)pointF.Y); Thread.Sleep(2000); MouseEvents.Click(); MouseEvents.Click(); Thread.Sleep(10000); //Get control of Module E AutomationElement aeModuleE = ModularityPage <SilverlightAppLauncher> .ModuleEContent; Thread.Sleep(3000); Assert.IsNotNull(aeModuleE); System.Windows.Point pointE = new System.Windows.Point(aeModuleE.Current.BoundingRectangle.X + aeModuleE.Current.BoundingRectangle.Width / 2, aeModuleE.Current.BoundingRectangle.Y + aeModuleE.Current.BoundingRectangle.Height / 2); Thread.Sleep(1000); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)pointE.X, (int)pointE.Y); Thread.Sleep(2000); AutomationElement aeModEtooltip = ModularityPage <SilverlightAppLauncher> .IntializedModuletooltip; Assert.IsFalse(aeModEtooltip.Current.IsOffscreen, "Module E Tooltip is offscreen"); //System.Windows.Point pointH = // new System.Windows.Point(aeModuleF.Current.BoundingRectangle.Width / 2, // aeModuleF.Current.BoundingRectangle.Height / 2); //System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)pointH.X, (int)pointH.Y); Thread.Sleep(1000); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)pointF.X, (int)pointF.Y); Thread.Sleep(1000); AutomationElement aeModFtooltip = ModularityPage <SilverlightAppLauncher> .IntializedModuletooltip; Assert.IsFalse(aeModFtooltip.Current.IsOffscreen, "Module F Tooltip is offscreen"); }
private static void MultipleStockSelectionforSubmitAllCancelAll() { System.Threading.Thread.Sleep(2000); AutomationElement PositionSummaryTabvalue = StockTraderRIPage <TApp> .PositionSummaryTab; System.Threading.Thread.Sleep(2000); System.Windows.Point clickablePoint = new System.Windows.Point((int)Math.Floor(PositionSummaryTabvalue.Current.BoundingRectangle.X), (int)Math.Floor(PositionSummaryTabvalue.Current.BoundingRectangle.Y)); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)clickablePoint.X, (int)clickablePoint.Y); Thread.Sleep(1000); MouseEvents.Click(); System.Threading.Thread.Sleep(3000); AutomationElement PositionSummaryGridValue = StockTraderRIPage <TApp> .PositionSummaryGrid; System.Windows.Point clickablePoint1 = new System.Windows.Point((int)Math.Floor(PositionSummaryGridValue.Current.BoundingRectangle.X + 500), (int)Math.Floor(PositionSummaryGridValue.Current.BoundingRectangle.Y + 100)); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)clickablePoint1.X, (int)clickablePoint1.Y); Thread.Sleep(1000); MouseEvents.Click(); System.Threading.Thread.Sleep(3000); }
private static void SLPopulateInvalidStockDetails() { AutomationElement SharesTextBoxValue = StockTraderRIPage <TApp> .SharesTextBox; SharesTextBoxValue.SetValue(GetDataFromTestDataFile("DefaultInvalidShares")); AutomationElement PriceLimitValue = StockTraderRIPage <TApp> .PriceLimitTextBox; PriceLimitValue.SetValue(GetDataFromTestDataFile("DefaultInvalidPriceLimit")); AutomationElement TermComboBoxValue = StockTraderRIPage <TApp> .TermComboBox; TermComboBoxValue.Expand(); System.Threading.Thread.Sleep(3000); AutomationElement TermValue = TermComboBoxValue.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, GetDataFromTestDataFile("DefaultTerm"))); Assert.IsNotNull(TermValue, "Could not find Order item in OrderType combobox"); System.Windows.Point clickablePoint = new System.Windows.Point((int)Math.Floor(TermValue.Current.BoundingRectangle.X), (int)Math.Floor(TermValue.Current.BoundingRectangle.Y)); System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)clickablePoint.X, (int)clickablePoint.Y); Thread.Sleep(1000); MouseEvents.Click(); }