Joh*_*ohn 5 selenium selenium-ide openlayers gwt-openlayers
我正在尝试使用硒来测试OpenLayers-2.13.1功能。我在单击鼠标,按下鼠标时遇到了问题。。。我发现了一些过时的帖子,但也遇到了类似的问题,但是它们的分辨率对我没有帮助。有谁知道可以自动测试开放层的任何软件。
http://lists.osgeo.org/pipermail/openlayers-users/2012-November/026791.html
小智 4
Selenium WebdriverIO我们在运行映射的自动化测试方面取得了一些成功。
我们解决地图点击问题的方法是通过从地图脚本中公开一个函数,我们可以从中获取地图上某个要素的像素位置。
function pixelOfFeature (id) {
return map.getPixelFromCoordinate(...coordinate of feature...)
}
Run Code Online (Sandbox Code Playgroud)
然后在我们的测试脚本中,一旦在加载的地图页面上,我们就在地图对象中查询我们想要单击的要素的像素,然后使用 webdriverio 我们可以将鼠标移动到地图 CSS 选择器中的像素值,然后执行 a .buttonPress().
var client = webdriverio.remote(options)
client.moveToObject('.map', pixel[0], pixel[1]).then(function(){
client.buttonPress(0).then(callback)
})
Run Code Online (Sandbox Code Playgroud)
http://webdriver.io/api/action/moveToObject.html
http://webdriver.io/api/protocol/buttonPress.html
然而,我们ol3可以采用相同的方法openlayers 2
对于OP来说可能为时已晚,但希望这可以帮助某人开始。
| 归档时间: |
|
| 查看次数: |
845 次 |
| 最近记录: |