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

How to get the current location of the Mouse

4 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kiran
Top achievements
Rank 2
Kiran asked on 20 Jul 2010, 06:27 PM
Hi,

I am using WebAii 2.0 for UI testing.
I would like to know how can i get the current mouse location.

Thanks
Kiran

4 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 21 Jul 2010, 09:57 AM
Hello kiran,

That is an interesting request but unfortunately there is no public API to achieve that yet. I'll log a feature request so that we can expose some method or property to get that in future version of the framework.

How critical is that issue for you? Can you also elaborate on the test scenario you need this for?

Greetings,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kiran
Top achievements
Rank 2
answered on 21 Jul 2010, 10:05 AM
Hi Konstantin Petkov,

Actually i neded to automate a flash application ( Farm Ville Game in Facebook).
But WebAii cant do that. So what i am planning is to make a utility Program through which i can define a boundary using mouse movement.

After this i will divide this boundary into equal number of Squares. And then i need to clik on the center of each square.
This is for automating ploughing, seeding and harvesting actions of Farmville game.

Is there any other mechanism through which i can get the current mouse location.

Thanks
Kiran

0
Accepted
Nikolai
Telerik team
answered on 21 Jul 2010, 11:45 AM
Hi kiran,

 In order to get the Mouse pointer position you can use the static Position property in System.Windows.Forms.Cursor class.

In order to do this follow these steps:
1. Add Reference to System.Windows.Forms dll to your project
2. Here is the code that will get the current mouse pointer:

var point = System.Windows.Forms.Cursor.Position;

Hope this helps.

Greetings,
Nikolai
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kiran
Top achievements
Rank 2
answered on 24 Jul 2010, 08:47 AM
Hi Nikolai,

The code provided by you is working for me.
I am marking this thread as answered.

Thanks
Kiran
Tags
General Discussions
Asked by
Kiran
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Kiran
Top achievements
Rank 2
Nikolai
Telerik team
Share this question
or