How to find a popup in the RadTreeView

10 posts, 1 answers
  1. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 19 Mar 2013 Link to this post

    Hello,

    The popup is displayed after the right click on the RadTreeViewItem. I am struggling with its identification. There is no Popup, RadContextMenu, ContextMenu and other possible WPF elements in the application. I have printed out all elements in the visual tree and could not find any traces of it. Is there any way in Telerik testing framework to identify this "popup" window with several items and click on one of them?

    I have also enclosed a screen shot of the popup to this thread.

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 22 Mar 2013 Link to this post

    Hello Stanislav,

    This is most probably RadContextMenu.

    Please try to refresh the visual tree before the click step calling .RefreshVisualTrees();

    Can you send us the application (or a sample one) so we can investigate it further and give you a solution. If it is not possible send us a screen shot of the entire DOM tree.

    Hope to hear from you soon.

    Regards,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. David
    David avatar
    4 posts
    Member since:
    Jan 2011

    Posted 24 Mar 2013 Link to this post

    Hello Boyan,

    Thank you for your reply. Unfortunately, it is not a RadContextMenu. I tried to refresh visual tree, but it did not help me.

    How can I send you a screen shot of a DOM tree? Do you have any tools to do so?

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 26 Mar 2013 Link to this post

    Hello Stanislav,

    You can use this very simple tool and check in the DOM tree what kind of control is that menu.

    Hope to hear from you soon.

    Greetings,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 26 Mar 2013 Link to this post

    Hello Boyan,

    Thank you for the link to this cool tool. Previously, I was using my own tool for looking into Xaml tree :-)

    I have enclosed a new screen shot from the Snoop application to this message.

    Please, let me know if you need more information. I hope this will help to come up with the solution to solve this issue.

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 28 Mar 2013 Link to this post

    Hi Stanislav,

    What I can see from the screen shot is that the parent element is Microsoft Popup control. It has a child which is ContextMenu

    Our Framework uses both of these controls, so there should not be a  problem to locate them. In the screen shot I am not able to see the attributes of the control. However the code should be a regular one for locating elements:

    FrameworkElement e = ActiveBrowser.SilverlightApps()[0].Find.ByExpression(new XamlFindExpression("xamltag=Popuproot"));
    Popup pop = e.As<Popup>();

    In order to assist you best and give you a coded solution we will need direct access to the application.

    Thank you for your understanding.

    All the best,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  7. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 01 Apr 2013 Link to this post

    Hello Boyan,

    I tried to locate the element the way you suggested, but it didn't help me. I have WPF application, and I was looking for Popuproot in MainWindow. Unfortunately, it returned null.

    I have enclosed the sample application. Can you take a look, please? The popup that I can't locate is appeared when you do a right click on the Log Out.

    Thank you. I look forward to hearing from you.

    Kind Regards,
    Stanislav Hordiyenko
  8. Answer
    Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 02 Apr 2013 Link to this post

    Hi Stanislav,

    Thank you for providing us with the application.

    The control of the pop up is Rectangle with name Bg. I was able to locate it and perform a click:

    FrameworkElement text = ActiveApplication.MainWindow.Find.ByTextContent("Log out");
    text.User.Click(MouseClickType.RightClick);
    ActiveApplication.MainWindow.RefreshVisualTrees();
    Rectangle rec = ActiveApplication.MainWindow.Find.ByName<Rectangle>("Bg");
    rec.User.Click();

    I recorded a short video as a demonstration.

    Hope this helps.  

    All the best,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  9. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 03 Apr 2013 Link to this post

    Hello Boyan,

    Thank you to resolve my issue.

    Kind Regards,
    Stanislav Hordiyenko
  10. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 04 Apr 2013 Link to this post

    Hello Stanislav,

    Great! I am glad to hear that this issue is resolved. 

    Please don't hesitate if you have additional questions.
     


    Regards,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top