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

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

问题描述

有没有人有一个谷歌地图API V3地图上Selenium测试(或其他浏览器测试环境)code的例子吗?具体来说,我希望与标记和弹出窗口进行互动。

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%优雅,但它的工作原理。设置优化:假上的标记。这使得他们都出现在地图(<一上href=\"http://$c$c.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions\">docs).然后在Selenium测试中的XPath选择器设置为'// DIV [@类=gmnoprint和@title] ,这将选择所有的标记。然后,您可以互动与标记。
又见这个谷歌集团<一个href=\"http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/144be1bd9ad9e1f8/55298ff39a6040a4?lnk=raot\">posting.

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.

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

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