void m_browser_Navigating(object sender, LoadedMoudleEventArgs e) { var container = sender as IContainer; PageTab tab = PageBrowser.GetPageTabByChild(sender as FrameworkElement); if (tab != null) { LoadingComponent component = tab.GetValue(LoadingSettingProperty) as LoadingComponent; if (container != null) { container.LoadProgress -= new EventHandler <LoadProgressEventArgs>(container_LoadProgress); container.LoadProgress += new EventHandler <LoadProgressEventArgs>(container_LoadProgress); } if (e.Status == LoadModuleStatus.Begin) { if (component == null) { component = this.GetInstance(tab) as LoadingComponent; component.Show(); } } else { if (component != null) { component.Hide(); } } } }
void Browser_Navigating(object sender, Core.Components.LoadedMoudleEventArgs e) { var container = sender as IContainer; var tab = PageBrowser.GetPageTabByChild(sender as FrameworkElement); if (tab != null) { var component = tab.GetValue(LoadingProperty) as LoadingComponentV2; //当下载XAP包的时候,显示下载进度条 if (container != null) { container.LoadProgress -= Contaner_LoadProgress; container.LoadProgress += Contaner_LoadProgress; } if (e.Status == Core.Components.LoadModuleStatus.Begin) { if (component == null) { component = this.GetInstance(tab) as LoadingComponentV2; component.Show(component.DefaultContainer); } } else if (component != null) { component.Hide(component.DefaultContainer); } } }
public void Test_MenubarMenu() { BrowserLogin("/demosite/Login.html", "admin", "password", "Login"); PageBrowser.FindId("Automation Tools").Hover(); Assert.That(PageBrowser, Shows.Css("ul > li > a > span", $"Selenium")); Assert.That(PageBrowser, Shows.Css("ul > li > a > span", $"BDD")); }
public void Test_MouseHover() { BrowserLogin("/demosite/Login.html", "admin", "password", "Login"); PageBrowser.FindId("Automation Tools").Hover(); PageBrowser.FindId("Selenium").Hover(); PageBrowser.FindId("Selenium RC").Hover().Click(); Assert.That(PageBrowser.HasContent("Selenium RC", Options.Substring)); }
public void Test_DialogBox() { BrowserLogin("/demosite/Login.html", "admin", "password", "Login"); PageBrowser.ClickButton("Generate"); //JavaScript Alert Box PageBrowser.AcceptModalDialog(); var dialogMessage = PageBrowser.HasDialog("You pressed OK!"); Assert.That(dialogMessage, "The message displayed is not the one we are expecting"); }
public static void BrowserLogin(string url, string username, string password, string loginButton, string browser = "chrome") { SetBrowserSession("executeautomation.com", browser); PageBrowser.Visit(url); PageBrowser.FillIn("UserName").With(username); PageBrowser.FillIn("Password").With(password); PageBrowser.ClickButton(loginButton, new Options() { WaitBeforeClick = TimeSpan.FromMilliseconds(2000), }); }
void container_LoadProgress(object sender, LoadProgressEventArgs e) { PageTab tab = PageBrowser.GetPageTabByChild(sender as FrameworkElement); if (tab != null && tab.View == null) { LoadingComponent component = tab.GetValue(LoadingSettingProperty) as LoadingComponent; if (component != null && component.m_loadingSpin != null) { component.m_loadingSpin.BusyContent = string.Format(MessageResource.LoadingComponent_Loading, e.ProgressPercentage); } } }
void Contaner_LoadProgress(object sender, Core.Components.LoadProgressEventArgs e) { var tab = PageBrowser.GetPageTabByChild(sender as FrameworkElement); if (tab != null && tab.View == null) { var component = tab.GetValue(LoadingProperty) as LoadingComponentV2; if (component != null && component.m_busyIndicator != null) { component.m_busyIndicator.BusyContent = string.Format(MessageResource.LoadingComponent_Loading, e.ProgressPercentage); } } }
public static void FillUserForm() { //Drop Down Select PageBrowser.Select("Mr.").From("TitleId"); //Text Box PageBrowser.FillIn("Initial").With("KK"); PageBrowser.FillIn("FirstName").With("admin"); PageBrowser.FillIn("MiddleName").With("adminMiddle"); //Radio Button PageBrowser.Choose("female"); //Check Box PageBrowser.Check("hindi"); //Button Click PageBrowser.ClickButton("Save"); }
public static void TestPopUp() { PageBrowser.ClickLink("HtmlPopup"); var popup = PageBrowser.FindWindow("Popup Window"); popup.Select("Mr.").From("TitleId"); popup.FillIn("Initial").With("KK"); //Close popup.ExecuteScript("self.close();"); //Fall back to parent window PageBrowser.FindWindow("Execute Automation"); //Initial PageBrowser.FillIn("Initial").With("KK"); // First Name PageBrowser.FillIn("FirstName").With("admin"); }
public Window(PageTab tab) { m_pageTab = tab; m_browser = tab.Parent as PageBrowser; }