3 posts, 0 answers
  1. Pete
    Pete avatar
    4 posts
    Member since:
    Sep 2012

    Posted 07 Mar 2013 Link to this post

    please provide some code samples for testing kendoeditor.

    1.  set value of kendo editor
    2.  click toolbar of editor
  2. Plamen
    Plamen avatar
    8 posts

    Posted 13 Mar 2013 Link to this post

    Hi Pete,

    The Kendo UI Editor is a mixture of many Kendo controls, which makes its automation a bit complicated. Also the text field of the Editor is inside of an IFrame, so you need to locate the IFrame first. Here's a sample code against this Kendo UI Editor demo side:
    myManager.LaunchNewBrowser(BrowserType.InternetExplorer, true);
    myManager.ActiveBrowser.NavigateTo("", true);
    //Find the iframe where the editor text field is located
    FrameInfo frameInfo = new FrameInfo("", "", "javascript:\"\"", 1);
    ArtOfTest.WebAii.Core.Browser frame = myManager.ActiveBrowser.Frames[frameInfo];
    //Find the editor text field
    var textField = frame.Find.AllByTagName("body").FirstOrDefault();
    //If the text field is not empty, clear the field
    myManager.ActiveBrowser.Actions.SetText(textField, "");
    //Enter the text
    myManager.Desktop.KeyBoard.TypeText("Kendo Editor testing", 50, 100);
    //Find all dropdown menus in the Kendo editor
    IList<KendoInput> editorDropdownMenus = ActiveBrowser.Find.AllByAttributes<KendoInput>("class=k-widget k-dropdown k-header");
    //Select font
    //Select size
    myManager.ActiveBrowser.Find.ByExpression<HtmlListItem>("tagname=li","TextContent=5 (18pt)").MouseClick();

    See this video for a demonstration and let me know if you need further assistance on this.

    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Srinivasan
    Srinivasan avatar
    15 posts
    Member since:
    Jun 2015

    Posted 16 Jun 2015 in reply to Plamen Link to this post

    The above doesn't select the font in the dropdownlist.
Back to Top