WebDriver simulate touch events in Desktop Browser

微笑、不失礼 提交于 2019-12-09 07:45:31

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 Driver allows to emulate chrome browser on mobile device. Read this article.

With jQueryMobile it is quite simple, I execute some Javascript which trigger the corresponding touch events from jQueryMobile.

((JavascriptExecutor)driver).executeScript("window.jQuery('#myId').trigger('swiperight')");

Maybe that helps.

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