WebDriver 模拟桌面浏览器中的触摸事件 [英] WebDriver simulate touch events in Desktop Browser

查看:40
本文介绍了WebDriver 模拟桌面浏览器中的触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Chrome 和 Firefox 浏览器模拟一些触摸事件,例如交换、点击基于 Web 的应用程序.我尝试使用 ActionsHummber.js, "Yahoo" lib(YUI) 但它们都不适合我.

I'm trying to simulate some touch events like swap, tap in web-based application using Chrome and Firefox browsers. I've tried to simulate touch events with Actions, Hummber.js, "Yahoo" lib(YUI) but none of them works for me.

在桌面浏览器中使用 webdriver 模拟触摸事件的最佳方法是什么?

What is the best way to simulate touch events with webdriver in desktop browsers?

推荐答案

我正在使用 幻肢 将鼠标事件转换为触摸事件.它对我有用.我认为在 Chrome 中模拟触摸事件的最佳方法是使用内置的模拟机制.就像在这篇文章中一样.不幸的是,我找不到通过 webdriver 打开此功能的方法.找到了启用触摸事件"、触摸事件"等 Chrome 选项.但它没有用.

I'm using phantom limb which transforms mouse events to touch events. It worked for me. I thing the best way to simulate touch events in Chrome is to use built-in emulations mechanism. Like in this article. Unfortunately I can't find the way to turn on this feature by webdriver. Found the Chrome options like "enable-touch-events", "touch-events" and etc. But it didn't worked.

UP:Chrome 驱动程序允许在移动设备上模拟 Chrome 浏览器.阅读这篇文章.

UP: Chrome Driver allows to emulate chrome browser on mobile device. Read this article.

这篇关于WebDriver 模拟桌面浏览器中的触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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