Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium WebDriver在桌面浏览器中模拟触摸事件_Selenium_Webdriver_Selenium Chromedriver_Touch Event - Fatal编程技术网

Selenium WebDriver在桌面浏览器中模拟触摸事件

Selenium WebDriver在桌面浏览器中模拟触摸事件,selenium,webdriver,selenium-chromedriver,touch-event,Selenium,Webdriver,Selenium Chromedriver,Touch Event,我正在尝试使用Chrome和Firefox浏览器在基于web的应用程序中模拟一些触摸事件,如交换、点击。我曾尝试用“lib”(YUI)模拟触摸事件,但没有一个适合我 在桌面浏览器中使用webdriver模拟触摸事件的最佳方法是什么?使用jQueryMobile非常简单,我执行一些Javascript,从jQueryMobile触发相应的触摸事件 ((JavascriptExecutor)driver.executeScript(“window.jQuery('myId')).trigger('s

我正在尝试使用Chrome和Firefox浏览器在基于web的应用程序中模拟一些触摸事件,如交换、点击。我曾尝试用“lib”(YUI)模拟触摸事件,但没有一个适合我


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

使用jQueryMobile非常简单,我执行一些Javascript,从jQueryMobile触发相应的触摸事件

((JavascriptExecutor)driver.executeScript(“window.jQuery('myId')).trigger('swiperight')”);
也许这会有帮助。

我正在使用它将鼠标事件转换为触摸事件。这对我有用。我认为在Chrome中模拟触摸事件的最好方法是使用内置的模拟机制。就像在文章里。不幸的是,我找不到通过webdriver启用此功能的方法。找到了诸如“启用触摸事件”、“触摸事件”等Chrome选项,但它不起作用

UP:Chrome驱动程序允许在移动设备上模拟Chrome浏览器。读这个