how-to-automate-google-map-using-appium.
Any suggestions please how to achieve.
how-to-automate-google-map-using-appium.
Any suggestions please how to achieve.
google maps is view inside your application?
Yes Aleksei.
The view is clustered view.
Scenario :
Assume Distributor A has 10 customers.
As soon as Distributor logged into application, he can able to see the all active customer’s locations in map where they are exactly.
Currently in cluster view, map showing 10 distributor(number(10) depends on active status of distributor) at one point as they are very nearer to each other. So if zoom in distributor can able to see the individual customer location point where he is exactly.
So now i have to automate below scenario:
1.After logged in need to get how many active customers showing in MAP.
Issue : In UI it is showing view like 4 RET or 2 RET, but when i spy using uiautomatorview i can able to spy the view but unable to get the number like 4 RET or 2 RET.
really do not want to start again with image recognition (i did it in previous project).
suggest first to try ask developers to add “title” or “snippet” value to markers.
when you tap on marker does any text appears?
So do you see a child “View” under the “Google Maps” View for each of your markers there? If so, ask your devs to fill out the “text” or “content-desc” for each with the text you need to retrieve. I had to ask my devs to do the same thing, and it makes automating so much more possible when they cooperate like that!
Thanks for the reply Aleksei. I will ask the developers to help on this.
Yes text is appearing like tool tip. In the above snap shot, if I click on any image it will display the respective person role(Dstrirbutor/Retailer/Customer) like tool tip. But that text also I am not able to spy using UIAutomatorview.
@Brian_Watson and @Aleksei . Thanks for your valuable replies. I will take the help from DEV.
One more issue.
If I zoom in, cluster will become as individual markers based on some criteria. So in this Zoom in process few markers will not be visible on mobile screen until we move the map. In that case how to know in which direction ma need to move to locate other markers.
Or is there any way to find out the all markers which are present in map but not on mobile UI without moving the map.
if they all on screen you can get size of views under google map view otherwise move only
Hi Aleksei,
As you said once i get the size, i am double clicking on cluster in MAP to Zoom in, to see individual items. So in this process Cluster will change over to individual Markers and few are showing in mobile UI and few are moving from mobile UI view. So if we move the map (either left/right/up/down) then only we can able to see the other items. So how to know in which direction MAP should move to see the items after ZOOM in.
Is there any way to get the all views present on MAP, even though not able to see mobile UI.
no. Android shows only what is on screen.
Is there any workaround or trail and error methods to achieve that
maybe you can ask dev to add value to some element on screen for automation as number of found distributors
Like was mentioned, on Android, Appium only knows about what is on screen at that time. So your test case will have to know which way to scroll based on your test data and the actions you are telling it to perform.
On iOS, I know Appium can getPageSource() for things that are off screen for the app I test.
Hi @Brian_Watson, Thanks for the info.
Is there any way to get current marker location where exactly on MAP.
Can you use the coordinates that are displayed above in your screenshot?
Hi @Aleksei , @anil.jogireddy,
I am trying to automate the application having the HERE maps view.
My scenario is:
Global.mDriver.findElementById(“com.xyz/addon_controls_Layout”).click();
Dimension size = Global.mDriver.manage().window().getSize();
new TouchAction(Global.mDriver).press(230,225).waitAction(1000).release().perform();
Using the above code, i can able to tap on the object. But it is not working if pan the map or device resolution is changed.
Another problem is: Unable to inspect the features(objects) which are having on the map.
Could you please help with the solution?
@Krish.gottipati hi.
Here’s some useful info on how to perform gestures: https://appiumpro.com/editions/67
Thanks for the help,
I will go through the above info and try to make it work. And i will let you know the outcome.