public override void Action() { Tab tab = (Tab)control; ITabPage iTabPage = tab.Pages.Where(x => x.Name.Replace(" ", "").Contains(criteria)).FirstOrDefault(); TabPage tabPage = (TabPage)iTabPage; if (actionType == ActionType.click) { tabPage.Click(); return; } if (actionType == ActionType.doubleClick) { tabPage.DoubleClick(); return; } if (actionType == ActionType.select) { tabPage.Select(); return; } throw new Exception($"Control Doesn't Accept Action Type {actionType}"); }
// Perry Hunter 06/10/2013 /// <summary>Selects the requested channel tab in the in the FGen window</summary> /// <summary>PREREQUISITE: Function Generator mode UI context</summary> /// <param name="channel">The requested channel number for the tab to be selected</param> public static void SelectFGenChannelTab(string channel) { string _tabName = null; // Decide which tab we requested if (channel == "1") { _tabName = AWGUI.FGenCh1Tab; } else if (channel == "2") { _tabName = AWGUI.FGenCh2Tab; } else { Assert.Fail("Requested channel " + channel + " is not defined"); } // Using the previously set context of the AWGUI:currentUIChildPanel from the "When I select the Functions button" step, // find the required tab control TabPage _tab = AWGUI.currentUIChildPanel.Get <TabPage>(SearchCriteria.ByAutomationId(_tabName)); Assert.IsNotNull(_tab); //For tabs, you must first select, then click the tab. _tab.Select(); _tab.Click(); //Set context to the control pane of the selected channel tab AwgContextFunctions.SetContextToSelectedFGenChannel(); }
public void CheckNetworksStatusTab() { TabPage FirstNetwork = MainWindow.Get <TabPage>(SearchCriteria.ByText("Handle.WPF.IrcNetworkViewModel")); Assert.IsNotNull(FirstNetwork); FirstNetwork.Click(); CheckStatusTab(); }
public void WhenIPressTheUserInterfaceLanguageInTheViewTabItem() { SearchCriteria searchCriteria1 = SearchCriteria.ByAutomationId("viewRibbon").AndByText("View"); TabPage view = (TabPage)window.Get(searchCriteria1); view.Click(); SearchCriteria searchCriteria2 = SearchCriteria .ByAutomationId("[Group : userInterfaceRibbonGroup Tools] Tool : IgCommandBarAction:UserInterfaceLanguageAction - Index : 0 ") .AndByText("User Interface Language"); Button userInterfaceLanguage = (Button)window.Get(searchCriteria2); userInterfaceLanguage.Click(); }
public void JoinNetwork() { Button join = NetworkWindow.Get <Button>("Connect"); join.Click(); NetworkWindow.Close(); MainWindow.Focus(); NetworksTab = MainWindow.Get <Tab>("Networks"); Assert.IsNotNull(NetworksTab); TabPage FirstNetwork = MainWindow.Get <TabPage>(SearchCriteria.ByText("Handle.WPF.IrcNetworkViewModel")); Assert.IsNotNull(FirstNetwork); FirstNetwork.Click(); }
public void SelectReportTab() { _reportTab.Click(); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { // settings for speed Mouse.DefaultMoveTime = 500; Keyboard.DefaultKeyPressTime = 50; Delay.SpeedFactor = 1.0; String PlayerUrl = "http://*****:*****@title~'^http://localhost/live_tes']/element[@class='WorkerW']//tabpagelist[@accessiblename='选项卡行']/tabpage[@accessiblerole='PageTab' and @accessibledescription~'^localhosthttp://localho' and @title='localhost' and @index='{0}']", i); TabPage tabPage = string.Format("/form[@title~'^http://localhost:9000/pub']/element[@class='WorkerW']//tabpagelist[@accessiblename='选项卡行']/tabpage[@accessiblerole='PageTab' and @accessibledescription~'^localhosthttp://localho' and @title='localhost' and @index='{0}']", i); tabPage.Click(); String text = repo.WwwCutvCom.HttpLocalhost9000PublicPlayerLive.StartAndBuffer.Caption; Report.Log(ReportLevel.Info, text); String newText = text.Replace("\\n", " "); Console.Out.Write(newText); string[] sArray = Regex.Split(newText, " ", RegexOptions.IgnoreCase); Report.Log(ReportLevel.Info, "start time:" + sArray[0]); Report.Log(ReportLevel.Info, "buffer number:" + sArray[1]); string status = "StartTime:" + sArray[0] + "-" + "BufferNumber:" + sArray[1]; PlayAgent.Commander.InvokeCmd("echo " + status + " > C:/cybertron/Controller/src/playServer/public/player/" + string.Format("{0}.html", ipList[i])); Report.Log(ReportLevel.Info, "Get Data for " + ipList[i]); Delay.Milliseconds(5000); } Delay.Milliseconds(60000); } }