Hi,
I'd like to test a WPF app that uses Telerik UI for WPF. I downloaded the Testing Framework. But I can't seem to click a RadRibbonButton by calling "button.User.Click()" method, even though the "button" variable seems to correctly point to the button:
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;
using Telerik.WebAii.Controls.Xaml.Wpf;
namespace UnitTestProject1
{
public class MainWindow : XamlElementContainer
{
public MainWindow(VisualFind find)
: base(find)
{
}
public void ClickSave()
{
const string Path =
"XamlPath=/Grid[0]/Grid[0]/Grid[0]/AdornerDecorator[0]/ContentPresenter[0]/RadRibbonView[0]/Grid[0]/Grid[0]/ContentPresenter[0]/Grid[0]/RibbonScrollViewer[0]/Grid[0]/ContentPresenter[0]/ItemsPresenter[0]/RibbonGroupsPanel[0]/RadRibbonGroup[0]/Grid[0]/GroupChrome[0]/Border[0]/Grid[0]/ContentPresenter[0]/ItemsPresenter[0]/RibbonButtonsPanel[0]/RadRibbonButton[1]";
var button = this.Get<RadRibbonButton>(Path);
button.User.Click();
}
}
}
I attach a sample project that demonstrate this behavior.
I'd appreciate any suggestions.
Thanks,
Tetsu
7 Answers, 1 is accepted


I further tracked down why it didn't work with X64. Turns out that ArtOfTest.WebAii.Win32.Win32NativeMethods.SendInputInternal(inputData) failed when simulating the mouse click. Does it have something to do with the following StackOverflow question - https://stackoverflow.com/questions/6830651/sendinput-and-64bits?
It's preferable that the framework can work in X64 mode because of some other tool that I'm using in the same test project to support Win32 dialog boxes.
I understand that you have resolved the issue already. I just want to confirm that Test Studio Framework is a 32 bit process and when you initially built your test with a 64 bit setting, this was causing the misbehavior.
I also want to add that the topic of the article is not related to Test Studio as it is a 32 bit process.
Thank you for digging in and finding a solution to the issue. Please do not hesitate to contact us again if you have any further questions about Testing Framework usage.
Regards,
Plamen Mitrev
Progress Telerik
Test Studio Trainings

Hi Plamen,
Thanks for the reply. I'm in the process of purchasing a support license for the framework. But, would you be able to fix the Win32NativeMethods class in the next update so that it can support both 32 and 64 bit environment? I suppose it's not a difficult task. The reason I'm trying to use some other library together with the framework is that the framework does not support Win32 dialog boxes. The library I'm using is called FlaUi. Unfortunately, it has its own bugs and only works in 64 bit mode. So, I can't use the two at the same time...
Tetsu
Thank you for your question and for sharing details regarding your scenario.
It is possible to use System.Windows.Forms to call for mouse click and keyboard press events, instead of the User.Click(), which is causing some issues. The framework and Test Studio is not designed to run as a 64bit application, because we encountered some limitations when we evaluated this change before.
I am sorry to let you know, that it is not possible to make the change at this point, but you can try the suggestion above and I will investigate further for another possible solution for you.
Than you for your understanding.
Regards,
Plamen Mitrev
Progress Telerik
Test Studio Trainings

Hi Plamen,
>The framework and Test Studio is not designed to run as a 64bit application, because we encountered some limitations when we evaluated this change before.
In that case, please don't bother anymore. I'll use the framework in 32 bit mode. And now I know how to deal with Win32 dialog boxes thanks to your help.
Thanks anyways.
I am glad to know that you are able to handle the dialog boxes, which were causing you troubles.
Thank you for your understanding and do not hesitate to contact us in the future.
Regards,
Plamen Mitrev
Progress Telerik
Test Studio Trainings