Automating Kendo UI controls

39 posts, 0 answers
  1. Naga
    Naga avatar
    15 posts
    Member since:
    Apr 2012

    Posted 13 Jun 2012 Link to this post

    Hello:

    I am automating an application which has majority of the controls build using KendoUI such as
    KendoGrid
    Kendo Temaplate etc


    Can you please help me how to identify these controls such as Kendo Grid and proceed further.Also please let me know Telerik Test tsudio completely supports Kendo UI controls or not.If not then from which version of test studio can we expect a complete support.

    Thanks,
    Naga
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 13 Jun 2012 Link to this post

    Hello,

    To give you an accurate answer how do you define "...completely supports Kendo UI controls..."? Test Studio supports any/all HTML elements/controls to one degree or another. It always has and always will. The real question is to what level of support are you seeking?

    Test Studio comes with a set of "translators" (extended support) for Silverlight controls, some of the common HTML controls, and our large set of RadControls. We do not have any translators for the special Kendo UI controls. That should not stop or prevent your test automation tasks however. Test Studio will recognize the base elements used to make up the Kendo UI controls and interact with and automate all of those elements out of the box.

    If you run into any specific problems please let us know.

    All the best,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 14 Jun 2012 Link to this post

    Hello,

    I must apologize and eat my own words now. A colleague reminded me we do have specific translators for Kendo UI. The list includes:

    • KendoCalendar
    • KendoGrid
    • KendoInput
    • KendoListview
    • KendoMenu
    • KendoPager
    • KendoPanelBar
    • KendoTabStrip
    • KendoTreeView
    • KendoWindow

    Sorry for not paying attention to this fact earlier!!

    All the best,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  4. Naga
    Naga avatar
    15 posts
    Member since:
    Apr 2012

    Posted 20 Jun 2012 Link to this post

    Can you please post few sample code snippets to work with Kendo UI controls.
  5. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 26 Jun 2012 Link to this post

    Hello Naga,

    I am sorry for the delay in getting back to you on this. Here are some samples with Kendo UI controls.

    Kendo Grid
     
    //Get the grid object
    KendoGrid grid = ActiveBrowser.Find.ById<KendoGrid>("grid");
     
     
    //Search for a row that contains "Chang" in its first cell
    foreach (KendoGridDataItem row in grid.DataItems)
    {
        if (row.Cells[0].TextContent == "Chang")
        {
            //Create a Confirm dialog
            ConfirmDialog cd = new ConfirmDialog(ActiveBrowser, DialogButton.OK);
            Manager.DialogMonitor.AddDialog(cd);
            Manager.DialogMonitor.Start();
     
            //Click on the last cell
            row.Cells[3].MouseClick();
     
            //Handle the Confirm dialog
            cd.WaitUntilHandled();
            Manager.DialogMonitor.RemoveDialog(cd);
        }
    }

    Kendo Calendar
     
    //Get the Calendar object
    KendoCalendar calendar = ActiveBrowser.Find.ById<KendoCalendar>("calendar");
     
    //Select date
    calendar.selectDay("2013, 09, 18");


    Kendo ComboBox    
     
    //ComboBox1
    HtmlControl label = ActiveBrowser.Find.ByExpression<HtmlControl>("for=categories");
    Assert.IsNotNull(label);
    KendoInput combo = label.BaseElement.GetNextSibling().As<KendoInput>();
     
    HtmlControl arrow = combo.Find.ByExpression<HtmlControl>("class=k-icon k-arrow-down");
    arrow.MouseClick();
     
    ActiveBrowser.RefreshDomTree();
     
    HtmlListItem item = ActiveBrowser.Find.ByContent<HtmlListItem>("Confections");
    item.MouseClick();
     
     
    //ComboBox2
    HtmlControl label2 = ActiveBrowser.Find.ByExpression<HtmlControl>("for=products");
    Assert.IsNotNull(label);
    KendoInput combo2 = label2.BaseElement.GetNextSibling().As<KendoInput>();
     
    HtmlControl arrow2 = combo2.Find.ByExpression<HtmlControl>("class=k-icon k-arrow-down");
    arrow2.MouseClick();
     
    ActiveBrowser.RefreshDomTree();
     
    HtmlListItem item2 = ActiveBrowser.Find.ByContent<HtmlListItem>("Pavlova");
    item2.MouseClick();
     
     
    //ComboBox3
    HtmlControl label3 = ActiveBrowser.Find.ByExpression<HtmlControl>("for=orders");
    Assert.IsNotNull(label);
    KendoInput combo3 = label3.BaseElement.GetNextSibling().As<KendoInput>();
     
    HtmlControl arrow3 = combo3.Find.ByExpression<HtmlControl>("class=k-icon k-arrow-down");
    arrow3.MouseClick();
     
    ActiveBrowser.RefreshDomTree();
     
    HtmlListItem item3 = ActiveBrowser.Find.ByContent<HtmlListItem>("London");
    item3.MouseClick();

    If you have a specific scenario that you want to automate, please describe it in details and I'll be glad to assist you in writing the code.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. Prasanna
    Prasanna avatar
    1 posts
    Member since:
    Feb 2013

    Posted 16 Feb 2013 Link to this post

    Hi Plamen,

    Is this above mentioned same code work with Firefox,etc browsers, please advise the code if it is different for other browsers.

    Regards,
    Prasanna
  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 19 Feb 2013 Link to this post

    Hi Prasanna,

    The code is the same for all browsers, however the implementation of some of these Kendo UI controls has been changed. Please provide detailed information on your automation scenario. What type of Kendo control you're testing and what is the problem you're experiencing? If you can provide access to your application or if you can point me to a similar publicly accessible application I'll be glad to assist you in writing the code. 

    Kind regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  8. sreekanth n
    sreekanth n avatar
    2 posts
    Member since:
    Jan 2010

    Posted 24 Aug 2013 Link to this post

    I used the sample code written for Calender.    As per the example given, it is supposed to pick up the 18th September 2013.
      
                //Select date
                calendar.selectDay("2013, 09, 18");
      
    But it is selecting 18th October 2013.    Even i tried with different month and date, it is always picks up following month's date.
  9. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 29 Aug 2013 Link to this post

    Hello Sreekanth,

    Yes, you are right. The month list starts from 0. So for January you should type 0, for February 1, for March 2, e.t.c.

    If you need additional assistance, please do not hesitate to contact us.

    Regards,
    Boyan Boev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  10. sreekanth n
    sreekanth n avatar
    2 posts
    Member since:
    Jan 2010

    Posted 29 Aug 2013 Link to this post

    When user enters date format like below, they expect same month and not following month.
    calendar.selectDay("2013, 09, 18"); 
      
    It will be very confusing.  Is it possible to provide a fix for this.
  11. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 03 Sep 2013 Link to this post

    Hi Sreekanth,

    You are right that this might be counterintuitive since in C#,  DateTime months are not Zero-based as they are in JavaScript Date Object. I filed feedback on your behalf on this problem, which you can follow in our Feedback Portal. 

    Thank you for your understanding.
     

    Regards,
    Velin Koychev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  12. Manjunath
    Manjunath avatar
    4 posts
    Member since:
    Dec 2013

    Posted 15 Dec 2013 Link to this post

    how can i find kendo listviewitem in listview?
  13. Manjunath
    Manjunath avatar
    4 posts
    Member since:
    Dec 2013

    Posted 15 Dec 2013 Link to this post

    How can i find the item in kendolistview?
  14. sreekanth n
    sreekanth n avatar
    2 posts
    Member since:
    Jan 2010

    Posted 16 Dec 2013 Link to this post

    We have written below code for KendoComboBox.

                HtmlControl sizeui = myManager.ActiveBrowser.Find.ById<HtmlControl>(capSizeId);
                HtmlListItem capSizeItem = sizeui.Find.ByContent<HtmlListItem>(selectCapSize);
                capSizeItem.Wait.ForExists();
                capSizeItem.Click();

    I feel we should be able to write on similar lines for KendoListView.
  15. Manjunath
    Manjunath avatar
    4 posts
    Member since:
    Dec 2013

    Posted 16 Dec 2013 Link to this post

    Hi Srikanth,

       Thanks for your responce. Your solution is not working for me. Could you please look at my kendo listview html content.


  16. Manjunath
    Manjunath avatar
    4 posts
    Member since:
    Dec 2013

    Posted 17 Dec 2013 Link to this post

    could you please help me out? How can i select kindolistview item from kendolistview
  17. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 18 Dec 2013 Link to this post

    @ Sreekanth - Thank you for sharing your experience.

    @Manjunath -

    You should be able to use code similar to the following:
    KendoListViewItem newItem = Find.ByExpression<KendoListViewItem>("id=lvAvailablePayers","|","tagIndex=div:0");
    This code should select the first KendoListViewItem. You can change the tagIndex depending on which item you need.

    You might find our documentation very useful for cases like this one.

    I hope this helps.

    Regards,
    Velin Koychev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  18. Manjunath
    Manjunath avatar
    4 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    Hi velin,


         Thank you for response.  I got another solution.


                KendoListView lvAvailablePayers = CurrentBrowser.Find.ById<KendoListView>("lvAvailablePayers");
                ReadOnlyCollection<HtmlDiv> items = lvAvailablePayers.Find.AllByAttributes<HtmlDiv>("role=option");
                items[0].MouseClick();
  19. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 20 Dec 2013 Link to this post

    Hi Manjunath,

    Thank you for sharing this solution. It is good to hear that you've been able to resolve this problem.

    Regards,
    Velin Koychev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  20. Darshana
    Darshana avatar
    14 posts
    Member since:
    Oct 2013

    Posted 11 Jun 2014 Link to this post

    Hi All, 

    I am facing same issue selecting value from kendoUI combobox. I tried code mentioned above, but still no luck. Please help me out here.

    In attached document, Code is for family drop down List, So if I want to select value from Family Drop Down List ,say for example option value "ABC", How do i select as a coded step? 

    I tried doing this way: 
    HtmlListItem value = ActiveBrowser.Find.ByContent<HtmlListItem>("ABC");
    value.MouseClick();

    And this code is throwing error like : Object reference not set to an instance of an object
    I think it might be getting Null value,but I need your advice to successfully select value from family Drop Down.


    Thank you.
  21. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 16 Jun 2014 Link to this post

    Hi Darshana,

    Thank you for contacting us.

    If you want to select the item by its text the code should look like:

    HtmlSelect mySelect = ActiveBrowser.Find.ById<HtmlSelect>("combo-family");
    mySelect.SelectByText("ABC");


    If you want to select if by its value:

    HtmlSelect mySelect = ActiveBrowser.Find.ById<HtmlSelect>("combo-family");
    mySelect.SelectByValue("675390");

    Hope this helps.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  22. Darshana
    Darshana avatar
    14 posts
    Member since:
    Oct 2013

    Posted 18 Jun 2014 in reply to Boyan Boev Link to this post

    Hi Boyan,

    Thanks for the response. I tried with this code and it is still not selecting any value, So based on above code, can you help me out how to open combo box? 

  23. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 23 Jun 2014 Link to this post

    Hello Darshana,

    Please give is more detailed information.

    What happens when you execute the code? Does the test fail?

    Send us the trace log.

    Can you please record a quick video using Jing to demonstrate the exact steps you take? 

    Hope to hear from you soon.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  24. Darshana
    Darshana avatar
    14 posts
    Member since:
    Oct 2013

    Posted 25 Jun 2014 in reply to Boyan Boev Link to this post

    Hi Boyan,

    I am getting error " Object reference not set to an instance of an object.".

    Before Code:(Working)

    Pages.OtherItemsLedgex.TC13401ProductDiv.Wait.ForExists();
    Pages.OtherItemsLedgex.TC13401ProductDiv.TypeText("xcastle Arbitrage LP");
    Pages.OtherItemsLedgex.TC13401ProductDiv.ToggleCombo();
    System.Threading.Thread.Sleep(250);
    Pages.OtherItemsLedgex.ListitemProductSelected.MouseClick();

    After Code:(Not Working)
    Pages.OtherItemsLedgex.TC13401ProductDiv.ToggleCombo();
    HtmlSelect mySelect = ActiveBrowser.Find.ById<HtmlSelect>("combo-product");
    mySelect.SelectByText("xcastle Arbitrage LP");

     So, for before Code , I am not confident about it whether it is right way to do it or not . And  for After Code, I want to write the way you have mentioned in the code above. But it is throwing an error. 

     I tried selecting value by recording, but it is taking List Item for that particular value , so because of that I can't reuse this object in other testcases/test steps. I have to record this object again if I want to select different value. 

     Let me know if you need more information.
     Thank you for your help.







  25. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 27 Jun 2014 Link to this post

    Hello Darshana,

    Which row is throwing the exception?

    Can you please record a quick video using Jing along with the DOM tree to demonstrate the exact steps you take? 

    Thank you!

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  26. Darshana
    Darshana avatar
    14 posts
    Member since:
    Oct 2013

    Posted 11 Jul 2014 in reply to Boyan Boev Link to this post

    Hi, I am attaching video and DOM file. 

    Thanks for your help.
  27. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 16 Jul 2014 Link to this post

    Hello Darshana,

    Thank you for the video, however I still cannot understand where is the problem.

    Please send me the execution log so I can debug it.

    Thank you!

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  28. Srinivasan
    Srinivasan avatar
    15 posts
    Member since:
    Jun 2015

    Posted 17 Jun 2015 Link to this post

    Hi,I am new to telerik testing.

    I am using c# code for automation testing in telerik framework.

    i need solution for how to check  the kendo K-widget k-treeview checkbox node based on given text.

     

    Thanks,

    Srinivasan.k

     

  29. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 21 Jun 2015 Link to this post

    Hello Srinivasan,

    Thank you for contacting us.

    Could you please send us a screen shot of the control as well as a screen shot of its DOM tree so I can assist you best with the code?

    Looking forward to hearing from you.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  30. George
    George avatar
    2 posts
    Member since:
    Feb 2016

    Posted 02 Feb in reply to Plamen Link to this post

    Hi I am automating a UI, finding the element as become so challenging.. right my clicking on some elements used to work but now it hasnt can you show me how to locate an element and how to design a better framework using Telerik. 
Back to Top