This is a migrated thread and some comments may be shown as answers.

Click silverlight element

4 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
george
Top achievements
Rank 1
george asked on 22 Jan 2015, 09:49 AM
Hi.
I've downloaded free telerik test framework.
and try to do the following with silverlight application:


var slApp = ActiveBrowser.SilverlightApps()[0];
var menu = slApp.Find.ByExpression(new XamlFindExpression("TextContent=Administration", "XamlTag=textblock"));
menu.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 30, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));

Actually, i had done it after i installed trial version of test studio to see if it is possible to click there.

From Test studio it works fine, but from my test it finds element, but doesn't want to click.
it there any solution for that?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 27 Jan 2015, 07:57 AM
Hi George,

Thank you for contacting us.

What exactly happens with the click? Does the test fail or just doesn't click?

Can you capture a screen recording of the test running and failing, so we can better understand the exact scneario? Jing is a good free screen recorder for up to 5 minutes of recording time.

Send us the trace log also.

Could you please try modifying the click row like this:

menu.User.Click();

Hope to hear from you soon. 

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
george
Top achievements
Rank 1
answered on 27 Jan 2015, 10:06 AM
Hi, thanks for the reply.
Sure, i've tried just
menu.User.Click()
It doesn't work - if just one click in test it is passed (as there is no any other actions), otherwise it is failed, as far as navigation is not performed.
The element is found and i can get properties from it, but click doesn't work.
I've tried:

  
slApp.Find.ByExpression(new XamlFindExpression("TextContent=Administration", "XamlTag=textblock")).User.Click();
 
 
slApp.Find.ByExpression(new XamlFindExpression("TextContent=Administration", "XamlTag=textblock")).User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 30, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
             
var menu = slApp.Find.ByExpression(new XamlFindExpression("TextContent=Administration", "XamlTag=textblock"));
menu.User.MouseEnter(ArtOfTest.Common.OffsetReference.TopLeftCorner);
menu.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 30, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner);
            
 
menu.User.ClickPoint(new System.Drawing.Point((int)menu.GetRectangle().X,(int)menu.GetRectangle().Y));
slApp.Find.ByExpression(new XamlFindExpression("TextContent=Quick Book")).User.Click();
 
myManager.Desktop.Mouse.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, new System.Drawing.Point((int)menu.GetRectangle().X, (int)menu.GetRectangle().Y));

non of those steps are failed - they just do not click element.

here is the link to screen capturing: http://screencast.com/t/n3qzAybU

Note: from test studio the element is clicked with the following line:
.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 30, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner,
ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
0
george
Top achievements
Rank 1
answered on 28 Jan 2015, 09:11 PM
Hi,
you can remove this thread.
i've found what was the issue
thanks
0
Boyan Boev
Telerik team
answered on 29 Jan 2015, 02:32 PM
Hello George,

Glad to hear that!

If you need further assistance please let us know.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
george
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
george
Top achievements
Rank 1
Share this question
or