RadGrid and RadContextMenu

Thread is closed for posting
5 posts, 0 answers
  1. Juho Saarinen
    Juho Saarinen avatar
    4 posts
    Member since:
    Oct 2009

    Posted 10 Nov 2009 Link to this post

    I have created tests for webpage, that utilizes heavily Telerik's RadControls for ASP.NET. Problem is, that some of the controls seem quite hard to found.

    One of these is RadContextMenu on RadGrid (same kind that on page: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandmenu/defaultcs.aspx?product=menu). I tried to find menu even with webUI studio, but without luck.

    And as in that example, in our solution Contextmenu is "tied" to rows (eg. affects only to row it's opened).

    Is there some easy way to find and interfere with that contextmenu?

    Framework for Testing is WebAii 2.0Beta.
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 11 Nov 2009 Link to this post

    Hello Juho,

    Indeed, the ContextMenu is a bit tricky to interact with especially on the framework level. Using an HTML output inspector like the Firefox Firebug add-on you may notice the element containing the menu items is actually rendered out of the HtmlForm. Additionally, the items holder element has no relation with the actual control needed for the control wrapper and WebUI Test Studio translator. This as a whole prevent us from supporting the ContextMenu on translator level excluding a few specific scenarios like the Grid Filtering menu and the built-in TreeView context menu.

    I've discussed the problem with the RadMenu devs here and we should come up with a solution shortly. I will make sure it will become officially part of the WebAii Testing Framework / WebUI Test Studio v2.0 release due in December.

    In the meantime there are a few possible options out of the RadControls translators.

    1. You can record a test based on the span element with the help of the Desktop Mouse Actions. I've attached such a test and you can find the options available in WebUI Test Studio v2.0 recording interface on the following snapshot.



    2. Additionally you can access and click on the base span element of the MenuItem via some code. See the code snippet I posted at this forum thread.

    I hope this helps. Please let me know if the official release of WebUI Test Studio v2.0 in December in addition to the next official release of RadControls for ASP.NET AJAX (Service Pack of Q3 2009 release) is acceptable timeframe for you. Alternatively we may prepare internal builds of both products including improved support of RadContextMenu in WebAii Testing Framework and WebUI Test Studio v2.0.

    Kind regards,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Juho Saarinen
    Juho Saarinen avatar
    4 posts
    Member since:
    Oct 2009

    Posted 11 Nov 2009 Link to this post

    Thank you very much, I was able to solve this problem with way other thread described. Little modification because of separate menus on separate lines.

    I think this was quite nice way to do it, maybe this should at leas be on those examples provided by WebAii framework installation.

    Find.ById<HtmlDiv>("Grid1_Context_000").Find.ByContent<HtmlSpan>("Move Down").Click(); 

    So basically first searching the wanted line's div (that contains the menu), then finding appropriate "button", and then clicking that. 
  4. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 11 Nov 2009 Link to this post

    Hello Juho,

    Indeed, we will add a similar scenario to the sample tests. Thanks for sharing your solution!

    Greetings,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 24 Nov 2009 Link to this post

    Hi Juho,

    This is just to let you know we've extended the RadContextMenu support in both WebAii Testing Framework and WebUI Test Studio v2.0. There is an internal build of the testing tools we've uploaded today. The build is labeled as 2009_3_1124 and can be found at the internal builds location:

    Latest internal builds

    Note, you will also need the latest internal build of RadControls for ASP.NET AJAX as the modification in the testing tools relies on a recent update of the RadContextMenu rendering. The first internal build of RadControls exposing the needed change has been uploaded this week (Nov 22). The change will be official with the Service Pack of RadControls Q3 2009 release.

    Should you have any other feedback, please let us know.

    Greetings,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top