Selenium tests for Google maps

£可爱£侵袭症+ 提交于 2019-12-18 02:49:31

问题


Does anyone have a code example for a Selenium test (or some other browser testing environment) on a Google Maps API V3 map? Specifically, I want to interact with the markers and popup windows.


回答1:


Solved. Not 100% elegant but it works. Set optimized : false on the markers. This makes them all appear on the map (docs). Then set the XPath selector in the Selenium test to '//div[@class="gmnoprint" and @title], this will select all the markers. You can then interact with the markers. See also this Google groups posting.




回答2:


It's been a long time since this question has been answered, but I think it's nice to post here another solution that offers other possibilities that didn't exist at the time, for people that are interested in that topic

You can use SikuliFirefoxDriver to automate Google Maps with WebDriver, with the image recognition tooling of hte great Sikuli software



来源:https://stackoverflow.com/questions/5779102/selenium-tests-for-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!