/// <summary> /// Clicks Bootstrap grid widget button. /// </summary> public void ClickBootstrapGridWidgetButton() { HtmlSpan gridButton = this.EM.Widgets.GridWidgets.BootstrapGridWidget .AssertIsPresent("Bootstrap grid widget button"); gridButton.ScrollToVisible(); gridButton.Focus(); gridButton.MouseClick(); }
/// <summary> /// Verifies media tooltip on mouse over. /// </summary> /// /// <param name="documentTitle">The media name.</param> /// <param name="libraryName">The library name.</param> /// <param name="dimensions">The media dimensions.</param> /// <param name="documentType">The media type.</param> public void VerifyMediaTooltip(string title, string libraryName, string type, string dimensions = "") { HtmlSpan tooltip = this.EM.Media.MediaSelectorScreen.Tooltip.AssertIsNotNull("tooltip icon"); string imageTooltipTitle = tooltip.Attributes.Where(a => a.Name == "sf-popover-title").First().Value; Assert.AreEqual(title, imageTooltipTitle, "Media title in tooltip is not correct"); tooltip.ScrollToVisible(); tooltip.Focus(); tooltip.MouseHover(); var tooltipContent = tooltip.Attributes.Where(a => a.Name == "sf-popover-content").First().Value; Assert.IsTrue(tooltipContent.Contains(libraryName), "Library name not found in the tooltip"); if (!dimensions.Equals(string.Empty)) { Assert.IsTrue(tooltipContent.Contains(dimensions), "Media dimensions not found in the tooltip"); } Assert.IsTrue(tooltipContent.Contains(type), "Media type not found in the tooltip"); }
public static void CreateNewForum(Browser br, Manager M, string Subject, string Messege, string Tags) { br.WaitUntilReady(); br.RefreshDomTree(); br.Window.SetFocus(); Thread.Sleep(3000); TechForum forum = new TechForum(M); HtmlSpan CreateTopicbutton = forum.CreateTopicButton.As <HtmlSpan>(); CreateTopicbutton.ScrollToVisible(); CreateTopicbutton.MouseHover(); CreateTopicbutton.MouseClick(); Thread.Sleep(3000); br.WaitUntilReady(); br.RefreshDomTree(); //EnterSubject br.Actions.SetText(forum.TopicSubject, Subject); Thread.Sleep(3000); br.WaitUntilReady(); br.RefreshDomTree(); //enterMessege ArtOfTest.WebAii.Core.Browser t1_frame = br.Frames[0]; Element TextEditor = t1_frame.Find.ByXPath("/html/body"); br.Actions.SetText(TextEditor, Messege); //Check on email checkbox br.Actions.Check(forum.SendEmail, true); //Enter tags br.Actions.SetText(forum.Tags, Tags); //click on post button br.Actions.Click(forum.PostButton); }
public void CreateArticle(string Heading, string Name, IList <string> ClubsList, string Introduction, string Description) { //name on the page myManager.ActiveBrowser.RefreshDomTree(); HtmlInputText NameOnPage = myManager.ActiveBrowser.Find.ById("dijit_form_ValidationTextBox_3").As <HtmlInputText>(); //NameOnPage.ScrollToVisible(); NameOnPage.MouseHover(); NameOnPage.MouseClick(); NameOnPage.Text = Name; //Select PreviewImage Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan PreviewImageButton = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_Button_.._label").As <HtmlSpan>(); PreviewImageButton.MouseClick(); //TreeExpand Thread.Sleep(7000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan TreeExpand = myManager.ActiveBrowser.Find.ByXPath("/html/body/div[58]/div[2]/div[3]/div/div/div[2]/div/div/div/div[2]/a/span/span[1]").As <HtmlSpan>(); TreeExpand.MouseClick(); Thread.Sleep(5000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan firstpng = myManager.ActiveBrowser.Find.ByXPath("/html/body/div[58]/div[2]/div[3]/div/div/div[2]/div/div/div/div[2]/div/div[10]/a/span/span[6]").As <HtmlSpan>(); firstpng.MouseClick(); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan okbuttonPicture = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_Button_.._label", "innertext=OK").As <HtmlSpan>(); okbuttonPicture.MouseClick(); //Add Heading myManager.ActiveBrowser.RefreshDomTree(); HtmlInputText HeadingtextBox = myManager.ActiveBrowser.Find.ById("dijit_form_ValidationTextBox_4").As <HtmlInputText>(); HeadingtextBox.Text = Heading; //SelectClub objAricle article = new objAricle(myManager); HtmlInputCheckBox CustomerCheckbox = article.ArticleCustomerCheckbox.As <HtmlInputCheckBox>(); HtmlInputCheckBox DeveloperCheckbox = article.ArticleDeveloperCheckbox.As <HtmlInputCheckBox>(); HtmlInputCheckBox TechnicalCheckbox = article.ArticleTechnicalCheckbox.As <HtmlInputCheckBox>(); HtmlInputCheckBox ParlimentCheckbox = article.ArticleCustomerCheckbox.As <HtmlInputCheckBox>(); foreach (string listItem in ClubsList) { switch (listItem) { case "Customer": CustomerCheckbox.MouseClick(); break; case "Developer": DeveloperCheckbox.MouseClick(); break; case "Technical": TechnicalCheckbox.MouseClick(); break; case "Parliment": ParlimentCheckbox.MouseClick(); break; default: CustomerCheckbox.MouseClick(); break; } } //CLick On Create Button Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan CreateButton = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_Button_._label", "innertext=Create").As <HtmlSpan>(); CreateButton.MouseClick(); Thread.Sleep(5000); //Click On the Edit Button Thread.Sleep(20000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan EditButton = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_ToggleButton_.", "title=All Properties").As <HtmlSpan>(); HtmlSpan EditButtonSpan = EditButton.Find.AllByTagName("span")[0].As <HtmlSpan>(); EditButtonSpan.ScrollToVisible(); EditButtonSpan.MouseHover(); EditButtonSpan.MouseClick(); Thread.Sleep(7000); //Adding Introduction //Add Heading myManager.ActiveBrowser.RefreshDomTree(); HtmlTextArea IntroductionField = myManager.ActiveBrowser.Find.ByExpression("id=#uniqName_..._.", "name=introduction").As <HtmlTextArea>(); IntroductionField.MouseClick(); IntroductionField.Text = Introduction; Thread.Sleep(5000); //Till the editor loads //Add Discription ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0]; Element TextEditor = t1_frame.Find.ByXPath("/html/body"); myManager.ActiveBrowser.Actions.SetText(TextEditor, Description); //Publish //Click on publish ObjEditMode editmode = new ObjEditMode(myManager); HtmlSpan PublishButton = editmode.PublishDropdown.As <HtmlSpan>(); PublishButton.ScrollToVisible(); PublishButton.MouseHover(); PublishButton.MouseClick(); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan Publish = editmode.PublishButton.As <HtmlSpan>(); Publish.MouseClick(); }
public void EditStanderPage(string Name, string TopContent) { //Click On the Edit Button Thread.Sleep(20000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan EditButton = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_ToggleButton_.", "title=All Properties").As <HtmlSpan>(); HtmlSpan EditButtonSpan = EditButton.Find.AllByTagName("span")[0].As <HtmlSpan>(); EditButtonSpan.ScrollToVisible(); EditButtonSpan.MouseHover(); EditButtonSpan.MouseClick(); Thread.Sleep(7000); //Click on the rightTogglebar to get blocks ObjEditMode editmode = new ObjEditMode(myManager); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan righttogglebar = editmode.RightPane.As <HtmlSpan>(); righttogglebar.MouseClick(); //click on the pin icon Thread.Sleep(5000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan PagesTreePin = editmode.RightSideBLockPin.As <HtmlSpan>(); PagesTreePin.MouseClick(); //Search for the top block HtmlInputText Searchforblocks = editmode.RightPaneSearchText.As <HtmlInputText>(); Searchforblocks.Text = TopContent; Searchforblocks.MouseClick(); myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, Searchforblocks.GetRectangle()); myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); Thread.Sleep(5000); myManager.ActiveBrowser.RefreshDomTree(); //Selected dev HtmlDiv Kbanner = myManager.ActiveBrowser.Find.ById("dgrid_4-row-16206").As <HtmlDiv>(); HtmlDiv topcontentarea = editmode.topcontentarea.As <HtmlDiv>(); var des = new System.Drawing.Point(); des.X = topcontentarea.ScrollTop + 50; des.Y = topcontentarea.ScrollLeft + 50; Kbanner.DragTo(topcontentarea, ArtOfTest.Common.OffsetReference.TopCenter, des); //Add other details ObjStanderd standerdpage = new ObjStanderd(myManager); HtmlInputText Heading = standerdpage.Heading.As <HtmlInputText>(); HtmlTextArea Introduction = standerdpage.Introduction.As <HtmlTextArea>(); //adding just the heading wont add the text to the contorl Heading.ScrollToVisible(); Heading.MouseHover(); Heading.MouseClick(); Heading.Text = _Heading; Introduction.ScrollToVisible(); Introduction.MouseHover(); Introduction.MouseClick(); Introduction.Text = _Introduction; ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0]; Element TextEditor = t1_frame.Find.ByXPath("/html/body"); myManager.ActiveBrowser.Actions.SetText(TextEditor, _BodyText); //Publish //Click on publish HtmlSpan PublishButton = editmode.PublishDropdown.As <HtmlSpan>(); PublishButton.ScrollToVisible(); PublishButton.MouseHover(); PublishButton.MouseClick(); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan Publish = editmode.PublishButton.As <HtmlSpan>(); Publish.MouseHover(); Publish.MouseClick(); Thread.Sleep(10000); myManager.ActiveBrowser.Refresh(); //Click on options dropdown myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); HtmlSpan OptionsButton = editmode.OptionsButton.As <HtmlSpan>(); OptionsButton.ScrollToVisible(); OptionsButton.MouseHover(); OptionsButton.MouseClick(); //Click on the URL Thread.Sleep(5000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); HtmlDiv OptionsDropdown = editmode.OptionsDropdown.As <HtmlDiv>(); HtmlAnchor pagelink = OptionsDropdown.Find.AllByTagName <HtmlAnchor>("a")[0]; pagelink.MouseClick(); Thread.Sleep(2000); ValidatePage(_Heading); }