I've been cruising the forum for some time now looking for a solution to the problem I'm facing. I see many threads similar to the issue I'm seeing but I have yet to find a solution in those threads that solve the problem.
I've exported the tests to run independently from Test Studio using nunit in the console. I've gotten the test to kick off and run filling out a login form up to the point of clicking the Login button. I can see the button, verify its clickable, highlight it, etc. However, when I go to click it using User.Click(), nothing happens. I've enabled annotations and it shows the click action occurring, yet the button is not clicked
I've tried clicking it through FindName:
this.App.FindName<
Button
>("PART_LoginButton").User.Click();
I've tried through the exported method from Test Studio:
Pages.<PageName>.SilverlightApp.PARTLoginButtonButton.User.Click();
Here is the source code of the button itself:
<
button
Name
=
"PART_LoginButton"
AutomationId
=
"PART_LoginButton"
Uid
=
"65158171"
>
<
grid
Uid
=
"34157240"
>
<
border
Name
=
"Background"
Uid
=
"57177053"
>
<
textblock
Name
=
"textBlock"
AutomationId
=
"textBlock"
Uid
=
"44831437"
>Login</
textblock
>
</
border
>
</
grid
>
</
button
>
Any assistance to get this code clicking that button would be greatly appreciated!
Thank you,
Tim Harrison
Edit: Added button source code.
14 Answers, 1 is accepted
(format code block not working for me at the moment, plain text coding incoming!)
Pages.Cognistix.SilverlightApp.PARTLoginButtonButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
Invoking the MouseClickType.LeftClick seemed to do the trick for me. May need to use whole ArtOfTest.WebAii.Core.MouseClickType.LeftClick.
*EDIT*
Identifying the element entirely through code has worked for me as well.:
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
app.Find.ByName<Button>("PART_LoginButton").User.Click(MouseClickType.LeftClick);
I remember trying something similar from the direct export from Test Studio. I tried it again just now with no change in the behavior. It still acts like it clicks, but doesn't actually click.
Another thing I feel I should note is that the actual mouse cursor does not move to that location. I remember that happened when I executed the tests through Test Studio. Is that perhaps a hint as to what is wrong? Or is it the case that the cursor does not actually need to move in order for the click to actually happen (much like how Selenium works)?
So to add to the list of things I've tried:
Daniel's suggestion:
Pages.<PageName>.SilverlightApp.PARTLoginButtonButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
Pages.<PageName>
.SilverlightApp.PARTLoginButtonButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter, ArtOfTest.Common.ActionPointUnitType.Percentage);
I've tried repeated other methods of setting focus, clicking, not specifying clicktype, etc...and they have all worked.
I'll see if I can download and try NUnit today to reproduce the behavior you are experiencing.
Thank you for contacting us.
Unfortunately I was not able to reproduce this behavior against a public application.
Since this is a specific application issue please:
1. Please provide us with a copy of your test and if it is possible grant us access to your application so we can reproduce the issue on our end and give you a solution.
2. If direct access is not possible, capture a Fiddler trace and attach it to this support ticket in a zip file. If you are unfamiliar with how to do so, this link will provide you with step-by-step instructions for download and use. Please make sure to enable 'Decrypt HTTPS traffic' and 'Store binaries' options (see attached image) before starting capture.
3. A Jing video demonstrating the issue may also help us to better understand what is happening.
Hope to hear from you soon.
Regards,
Boyan Boev
Telerik
Test Studio Trainings
I faced with the same problem on Win7 Professional SP1 64bit.
Action: Button.User.Click();
Expected result: a button is clicked;
Actual result: a button is not clicked.
The same application works fine on WinXP SP3
I use WebAii 2011.2.1413.0, but also tried it with the latest version 2013.1.911.0
May 64bit cause the problem? Does WebAii support Win7 64bit?
Thanks
Thank you for contacting us.
As I said to Tim, we need to reproduce the issue on our end so we can debug it.
1. Please provide us with a copy of your test and if it is possible grant us access to your application so we can reproduce the issue on our end and give you a solution.
2. If direct access is not possible, capture a Fiddler trace and attach it to this support ticket in a zip file. If you are unfamiliar with how to do so, this link will provide you with step-by-step instructions for download and use. Please make sure to enable 'Decrypt HTTPS traffic' and 'Store binaries' options (see attached image) before starting capture.
3. A Jing video demonstrating the issue may also help us to better understand what is happening.
4. Send us the trace log or any other error output which can helps us diagnose the problem.
Yes, WebAii supports Win 7 64 bit, that should not be the reason of the problem.
Hope to hear from you soon.
Boyan Boev
Telerik
Test Studio Trainings
Is there any explanation for this yet?
The mouse click does not work for me either under a specific context.
1) I created a test application in VS 2012 and the mouse click works fine.
2) I added the Telerik Testing Framework into an existing Silverlight app and the mouse click works fine.
3) I added the Telerik Testing Framework into a an existing WPF application which is testing the Silverlight app above and the mouse click does not work. The mouse cursor does not move to the button, it stays where it is. It looks like the security context of the browser initiated by the WPF application is different than the app 1 and 2 above.
I've been trying to figure out what is going on without progress.
Many thanks
I created a test application from scratch in VS2012 using WebAii 2013.1.911.0 and the mouse click works fine.
But no luck with my main test application, which a bit complicated. I am going to investigate it deeply and get back with a result.
@Andrey, please take your time and update this thread accordingly.
@Stephen, as I wrote to Andrey, we need to reproduce this locally so we can debug the issue deeper.
Please check out my post to him.
Hope to hear from you soon.
Boyan Boev
Telerik
Test Studio Trainings
Here is my configuration:
Windows 7 64 bit
WebAii 2011.2.1413.0
NUnit 2.5.9.10348
Issue: User.Click() not clicking in Silverlight application if test is defined with TestFixure (NUnit). Everything works fine if test is defined with TestMethod (MS Test).
Solution to make NUnit work:
1) Visual Studio - Solution Explorer - Project Properties - Build - Platform target change from Any CPU to x86
2) run tests with nunit-x86.exe
To make NUnit tests run from Visual Studio with ReSharper:
1) Visual Studio - ReSharper - Options - Tools - Unit Testing - nUnit - Specified NUnit installation - define path to the NUnit folder with nunit-x86.exe
Thank you very much for sharing this information.
I have update your Telerik points.
We appreciate your feedback, which we rely on to improve our product.
Regards,
Boyan Boev
Telerik
Test Studio Trainings
Glad to hear this post has been helpful to you.
Should you have any additional questions or comments let us know or submit a new thread/ticket.
Regards,
Ivaylo
Progress Telerik
Test Studio Trainings