开发者

How to get the zoom level of a mapview in Android when writing the test cases using solo in Robotium

开发者 https://www.devze.com 2023-03-29 22:38 出处:网络
I amworking on Robotium to perform an automation test an开发者_StackOverflow中文版 Android application.

I am working on Robotium to perform an automation test an开发者_StackOverflow中文版 Android application. in side the application a map view has to get the zoom levels. Can any one explain how to get the zoom level of a map view by using Solo Object in Robotium tool?


Try something like this:

MapView map = (MapView)solo.getCurrentActivity().findViewById(your.package.name.R.id.google_maps);
int zoom = map.getZoomLevel();

I just tried this on my robotium testcase and it worked. Also, you should try accepting answers, you'll get better/more responses! Good luck

0

精彩评论

暂无评论...
验证码 换一张
取 消