/// <summary> /// Sets the Paragraph Text Content in the Frontend of the form /// </summary> public void SetParagraphTextContent(string content) { HtmlTextArea textbox = this.EM.Forms.FormsFrontend.ParagraphTextBox.AssertIsPresent("Text field"); textbox.MouseClick(); Manager.Current.Desktop.KeyBoard.TypeText(content); }
/// <summary> /// Change label of multiple choices and checkbox fields /// </summary> /// <param name="text">Text</param> public void ChangeLabel(string text) { HtmlTextArea textArea = EM.Forms.FormsBackend.TextArea .AssertIsPresent("Text area"); textArea.ScrollToVisible(); textArea.Focus(); textArea.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
/// <summary> /// Remove the Paragraph Text Content in the Frontend of the form /// </summary> public void RemoveParagraphTextContent() { HtmlTextArea textbox = this.EM.Forms.FormsFrontend.ParagraphTextBox.AssertIsPresent("Text field"); textbox.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); HtmlDiv label = this.EM.Forms.FormsFrontend.ParagraphTextField.AssertIsPresent("Paragraph field"); label.Focus(); label.MouseClick(); }
/// <summary> /// Sets the new message for success. /// </summary> /// <param name="text">The text.</param> public void SetNewMessageForSuccess(string text) { ActiveBrowser.RefreshDomTree(); HtmlTextArea messageArea = EM.Forms.FormsBackend.MessageArea .AssertIsPresent("Message area"); messageArea.ScrollToVisible(); messageArea.Focus(); messageArea.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
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); }