/// <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> /// 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 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); }