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
9 Answers, 1 is accepted
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.
Boyan Boev
the Telerik team
Test Studio Trainings
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
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.
Boyan Boev
the Telerik team
Test Studio Trainings
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
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
Test Studio Trainings
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
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
Test Studio Trainings
Thank you to resolve my issue.
Kind Regards,
Stanislav Hordiyenko
Great! I am glad to hear that this issue is resolved.
Please don't hesitate if you have additional questions.
Boyan Boev
the Telerik team
Test Studio Trainings