带有触摸事件的 WEBdriver [英] WEbdriver with Touch events

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

问题描述

我想使用 iOS iPad 或 Android 平板电脑的 Java 代码在 Selenium WebDriver 中使用触摸/点击事件.

I wanted to use touch/tap events in Selenium WebDriver using Java code for iOS iPad or Android tablets.

我该怎么做?

推荐答案

是的,您可以使用 AndroidDriver 在 Android 设备上测试 Web 应用程序/网站.
链接:Android WebDriver
对于 iOS,有适用于 iPhone 的 WebDriver
链接:iPhone WebDriver
另外,请检查:适用于移动浏览器的 WebDriver

由于驱动程序是用于 Web 视图/页面的自动化测试,因此它们没有像本机应用程序自动化框架那样的开箱即用的触摸/点击事件.
您应该尝试使用 jQuery Mobile API 在网页上执行触摸/点击事件.使用 selenium webdriver 的 JavascriptExecutor 并执行jquery 使用执行器.
检查这个:jQuery Mobile Tap

Yes there is AndroidDriver that you can use to test a web application / web site on an Android device.
Link: Android WebDriver
For iOS, there is WebDriver for iPhone
Link: iPhone WebDriver
Also, do check this: WebDriver for Mobile Browsers

Since, the drivers are for automation testing of web views/pages they don't have out of the box touch/tap events like native app automation frameworks.
You should try to use jQuery Mobile API to perform touch/tap events on web-pages. Use JavascriptExecutor of selenium webdriver and execute jquery using the executor.
Check this: jQuery Mobile Tap

这篇关于带有触摸事件的 WEBdriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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