Reputation: 21
I am new to Robotium .For the method clickLongOnScreen(x, y)
, I know x and y are the coordinates. But how can I get coordinates value ? Please help me.
Upvotes: 2
Views: 1274
Reputation: 225
If u have the view id, you con use the following to write test case that work on all screen sizes.
int[] location = new int[2];
View view = solo.getView(id);
view.getLocationOnScreen(location);
int x= location[0];
int y= location[1];
Upvotes: 0
Reputation: 14622
Upvotes: 3