This is a migrated thread and some comments may be shown as answers.
Click and LeftClick Default Settings
2 Answers 27 Views
This is a migrated thread and some comments may be shown as answers.
Sonny
Top achievements
Rank 1
Sonny asked on 24 Apr 2012, 06:05 PM
Is there a way to set the behavior to always use

OffSet Reference: AbsoluteCenter
Point Unit: Pixel
Point X: 0
Point Y: 0

So that I don't have to always manually change it every time I create the event?

Sincerely,

Sonny

2 Answers, 1 is accepted

Sort by
0
Jonas
Top achievements
Rank 2
answered on 25 Apr 2012, 10:34 AM
Hello Sonny,

One way in doing this is by making one extension on UserInteraction.Click()
So each time you use click, you can simply use your own extension of click().
For example:

public static void Click(this UserInteraction user, ArtOfTest.WebAii.Core.MouseClickType clicktype)
{
            user.Click(clicktype, value1,value2,value3,value4..);
}

The UserInteraction is in the ArtOfTest.WebAii.Silverlight namespace.
I've attached a file that shows how this will look like when u use it.
Perhaps there is another sollution out there, but i guess this one will do the trick for you.

Good luck.

Best Regards.
Jonas
0
Ivaylo
Telerik team
answered on 27 Apr 2012, 02:52 PM
Hello Sonny,

You can use this code but please note that extension methods can only be declared in a static class:

public static void Click(this UserInteraction user, ArtOfTest.WebAii.Core.MouseClickType clicktype)
       {
           user.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);
       }
Regards,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Asked by
Sonny
Top achievements
Rank 1
Answers by
Jonas
Top achievements
Rank 2
Ivaylo
Telerik team
Share this question
or