Problem locating dropdown

9 posts, 0 answers
  1. Iliya
    Iliya avatar
    5 posts
    Member since:
    Nov 2017

    Posted 14 Dec 2017 Link to this post

    Hello everyone,

    I am really new to Telerik Testing Framework and I found my first kind of a blocker. I need to locate a dropdown.

    The HTMl is attached.

    The following attempts are not successful:

    RadDropDownList typeDropdown = manager.ActiveBrowser.Find.ByContent<RadDropDownList>("l:One off");

    HtmlSelect typeDropdown = manager.ActiveBrowser.Find.ByContent<HtmlSelect>("l:One off");

     

    When I try to locate it as a simple element and to click on it is OK:

    var typeDropdown = manager.ActiveBrowser.Find.ByContent("l:One off"");

     

    I am really sorry if my question is not clear or is on the wrong place.

     

    Best reagrds,

    Iliya I.

     

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    934 posts

    Posted 18 Dec 2017 Link to this post

    Hello Iliya,

    Thank you for reaching us out. 

    As per the shared html it seems that the dropdown is actually the span right under the parent div - the one with class k-widget k-dropdown k-header full-width. You would need to locate it and cast it as a Kendo input since the Kendo dropdown is a type of Kendo input.

    To access the elements in the list when the dropdown is opened you would need to first trigger opening the dropdown list, then locating the element you would need to select as per the scenario. 

    I hope this will be helpful to you! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Iliya
    Iliya avatar
    5 posts
    Member since:
    Nov 2017

    Posted 14 Feb in reply to Elena Tsvetkova Link to this post

    Thanks a lot. It works for me.

     The next problem I faced is locating and handling a multiselect drop down. I am wandering to what type to cast.

     Thanks

  4. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    934 posts

    Posted 16 Feb Link to this post

    Hi Iliya,

    To be able to provide any advice I will need your page or the DOM tree of it. Could you please provide the page or its html code for the element you have difficulties with? 

    Thanks! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  5. Iliya
    Iliya avatar
    5 posts
    Member since:
    Nov 2017

    Posted 16 Feb in reply to Elena Tsvetkova Link to this post

    Hello Elena,

    I succeeded with handling the multiselect.

    Now I face very strange problem. As you can check the attached HTML file I successfully locate each elements in the grid row. All desired text is filled in them and the confirm button is clicked successfully.

    But the app throws error message that the grid cells are empty which is very odd because I can see the desired inputted text in them.

    How can I handle it?

     

    Regards,

    Iliya

  6. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    934 posts

    Posted 16 Feb Link to this post

    Hi Iliya,

    Thanks for the feedback. 

    I am not familiar with the code you had applied. But as of the description of the current behavior I suspect that you need to either simulate real user behavior (which will trigger the JS events for that elements) or add code to trigger these explicitly. 

    To simulate real user you probably would need to use the Keobard Manager TypeText Method. 

    Please give these a try and consider sharing your application and a sample code which you have troubles with in case further assistance will be required. 

    Thanks! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  7. Iliya
    Iliya avatar
    5 posts
    Member since:
    Nov 2017

    Posted 17 Feb in reply to Elena Tsvetkova Link to this post

    Hello Elena,

    I found the desired row from the table as HtmlInputControl which does not have a method TypeText.

    var newBusinessName = manager.ActiveBrowser.Find.ByExpression<HtmlInputControl>("tagname=input", "name=Name", "class=k-input k-textbox");
    manager.ActiveBrowser.Actions.SetText(newBusinessName, "fsdfsfsdfsdf");

    When I changed the element to KendoInput it is returned as null.

    I hope you are able to understand my explanation.

    Regards,

    Iliya

  8. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    308 posts

    Posted 21 Feb Link to this post

    Hi Iliya,

    If you need to work with the "KendoInput" wrapper it will be necessary to locate the outermost "span" element that contains the "k-widget" class.
    Please, refer to the attached screenshot for clarification.

    Best Regards,
    Nikolay Petrov
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  9. Iliya
    Iliya avatar
    5 posts
    Member since:
    Nov 2017

    Posted 24 Feb Link to this post

    Thanks both! Very helpful.
Back to Top