谷歌地图的硒测试 [英] Selenium tests for Google maps

查看:22
本文介绍了谷歌地图的硒测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人在 Google Maps API V3 地图上提供 Selenium 测试(或其他一些浏览器测试环境)的代码示例?具体来说,我想与标记和弹出窗口进行交互.

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.

推荐答案

已解决.不是 100% 优雅,但它有效.在标记上设置 optimized : false .这使它们都显示在地图上(docs).然后将Selenium 测试中的XPath 选择器设置为'//div[@class="gmnoprint" and @title],这将选择所有标记.然后,您可以与标记进行交互.另请参阅此 Google 群组发帖.

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.

这篇关于谷歌地图的硒测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆